HTTP module
Last updated
Was this helpful?
Last updated
Was this helpful?
The HTTP module is used to make HTTP requests from Flow Connect applications.
All the functions in the HTTP module provide the option to specify request headers. The request headers are specified as records. If you do not want to specify any request headers, you can use an empty record {}
.
The responses from the functions in the HTTP module contain an indicating whether the request was successful. Generally, status codes between 200 and 299 are considered successful. It is the responsibility of the Flow developer to check the status code of each response from the HTTP module.
The reasonPhrase
member of the responses contain a textual description of the status code.
The responses from the functions in the HTTP module also contain response headers. Unlike the request headers, the response headers are formatted as a sequence of key/value pairs where each entry may have more than one value.
Signature: (url: text, headers: { }) -> HTTPResponse<text>
Makes an HTTP GET request with the specified URL and headers. The returned record contains the response data (if any) as a text value.
Signature: (url: text, headers: { }) -> HTTPResponse<binary>
Makes an HTTP GET request with the specified URL and headers. The returned record contains the response data (if any) as a binary value.
Signature: (url: text, headers: { }, body: text) -> HTTPResponse<text>
Makes an HTTP POST request with the specified URL, headers and body. The body is taken in text format, and the returned record contains the response data (if any) as a text value. If no Content-Type header is specified, the Content-Type will be passed as text/plain
.
Signature: (url: text, headers: { }, body: binary) -> HTTPResponse<binary>
Makes an HTTP POST request with the specified URL, headers and body. The body is taken in binary format, and the returned record contains the response data (if any) as a binary value. No Content-Type header is added automatically.
Signature: (url: text, headers: { }, body: text) -> HTTPResponse<text>
Makes an HTTP PATCH request with the specified URL, headers and body. The body is taken in text format, and the returned record contains the response data (if any) as a text value. If no Content-Type header is specified, the Content-Type will be passed as text/plain
.
Signature: (url: text, headers: { }, body: binary) -> HTTPResponse<binary>
Makes an HTTP PATCH request with the specified URL, headers and body. The body is taken in binary format, and the returned record contains the response data (if any) as a binary value. No Content-Type header is added automatically.
Signature: (url: text, headers: { }, body: text) -> HTTPResponse<text>
Makes an HTTP PUT request with the specified URL, headers and body. The body is taken in text format, and the returned record contains the response data (if any) as a text value. If no Content-Type header is specified, the Content-Type will be passed as text/plain
.
Signature: (url: text, headers: { }, body: binary) -> HTTPResponse<binary>
Makes an HTTP PUT request with the specified URL, headers and body. The body is taken in binary format, and the returned record contains the response data (if any) as a binary value. No Content-Type header is added automatically.
Signature: (url: text, headers: { }) -> HTTPResponseNoBody
Makes an HTTP HEAD request with the specified URL and headers. The returned value has no contents, only status code, reason phrase and response headers.
Signature: (url: text, headers: { }) -> HTTPResponseNoBody
Makes an HTTP DELETE request with the specified URL and headers. The returned value has no contents, only status code, reason phrase and response headers.