Skip to content

Http.Get

Name Mandatory Description Default Type
⬅️ Input The input for this shard should either be none or an optional string table of query parameters to append to the URL. None{String}
Output ➡️ The output is the response from the server through the GET request. {status: Int headers: {String} body: Bytes}Bytes{status: Int headers: {String} body: String}StringObject
URL No The url to request to. `` StringVar(String)
Headers No If a table of headers is provided, it will be used as is; if no headers are provided, a Content-Type header will be derived based on the input type. none None{String}Var({String})
Timeout No How many seconds to wait for the request to complete. 10 Int
Bytes No If instead of a string the shard should output bytes. false Bool
FullResponse No If the output should be a table with the full response, including headers and status. false Bool
AcceptInvalidCerts No If we should ignore invalid certificates. This is useful for testing but should not be used in production. false Bool
Retry No How many times to retry the request if it fails. 0 Int
KeepAlive No If the client instance should be kept alive, allowing connection reuse for multiple requests. The client won't be closed until this shard cleans up. false Bool
Streaming No If the response should be streamed, in which case the output will be an object to use with the Http.Stream shard. false Bool
Backoff No How many seconds to wait between retries. Defaults to 1 second. 1 Int

This shard sends a GET request to the specified URL and outputs the response.

Details

This shard can accept a string table as input to append query parameters to the specified URL. For example,

{
  "param1": "value1"
  "param2": "value2"
  "param3": "value3"
} = query-params

query-params
Http.Get("https://api.example.com/endpoint")
The Http.Get shard will append the query parameters to the URL and the resulting constructed URL will be: https://api.example.com/endpoint?param1=value1&param2=value2&param3=value3

The Http.Get shard can handle the different responses that could be returned by the server. - HTML content: A web page's structure and content. - Plain text: Simple text data. - JSON (JavaScript Object Notation): Structured data commonly used in APIs. - XML (eXtensible Markup Language): Another format for structured data. - Binary data: Such as images, audio files, or documents. - Status codes: Indicating success (200 OK), redirection (3xx), client errors (4xx), or server errors (5xx). - Headers: Metadata about the response, like content type, caching instructions, or cookies. - Empty response: In some cases, with just a status code.