Using the HTTP Request component, you can send an HTTP request to a specified URL.

The HTTP Request component executes the HTTP request with the input payload as the Body content of the HTTP request, depending on its properties, and writes the HTTP response Body to the output payload (cv.Payload).

Body content in HTTP requests with Content-Type property

Content-Type Property Content of the Body at the time of the HTTP request
None The input payload executes the HTTP request without being set to the Body.
Default Automatically selects the Content-Type based on the type of the input payload.
Character string type Output characters with “text/plain; charset=utf-8”.
JSON array, JSON object The HTTP request is executed as “application/json”, marshalling the Payload as a byte string.
Byte sequence The HTTP request is executed with the string set to “application/octet-stream” as the Body.
Other The HTTP request is executed with the string set to “text/plain” as the body.
application/x-www-form-urlencoded The input payload is a JSON object type, the key and the value are sandwiched between the key and the value by “=”, each of which is separated by “&” in the body, and then the HTTP request is executed. (In this case, if data other than the JSON Object type is received as input, an error occurs.)
multipart/form-data The input payload is JSON Object type, and the key and the value are separated by multipart, and the Content-Type multipart/form-data is automatically attached to the boundary before the HTTP request is executed. (In this case, if data other than the JSON Object type is received as input, an error occurs.)
Any other arbitrarily entered Content-Type The Content-Type is left as it is and the output is a string of bytes of the input payload as the Body.
Output Payload Description
cv.Payload The output payload (cv.Payload) stores the body of the HTTP response as a string of bytes.

Properties

Name Required Description
Method True The HTTP Request Method
URL True The endpoint URL
Content-Type True The HTTP Header Content-Type
Authorization True The authorization type. When specified by the value of cp.Authorization, it can be one of “(none)”, “prebasic”, “basicdigest”, or “bearer”.
Username False Basic authentication username
Password False Basic authentication password
Token False The Bearer Token
Allow invalid certs False Allow invalid certificates
Timeout True HTTP Request Timeout (ms)
HTTP Proxy False HTTP Proxy
Proxy URL False URL when using a proxy
Proxy Username False Username when using a proxy
Proxy Password False Password when using a proxy
Dump True Dump the request/response to an output

Component Variables

cv.Payload On input: request body, on output: response body.
cv.StatusCode Request result
cv.Headers On input: request header, on output: response header.
cv.ContentLength Response content length

Testing the HTTP Requests

We recommend a free service called requestbin.com to create a testing endpoint and to send your HTTP requests to. In their live dashboard you can see the incoming requests. (Note, the above link creates a public requestbin. For private requestbins, you will need an account).

Overriding or Extending Header Information

You can add or override existing Header information by creating a PreMapping using this this JSON syntax:

cp.Headers = {"X-Header-1": "abc; def", "X-Header-2": ap.Timeout/1000, "X-Header-3": true, "X-Header-4": cp.URL, "Accept", "application/json", "User-Agent", "fugahoge browser"}

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.