Skip to content

HTTP Client Service

Enable your Murano solution to make HTTP requests.

This service allows Event Handlers in Murano to make HTTP requests to external servers.

You can use this post device data to an existing business system, integrate with a 3rd party web application, or many more use cases.

Operations

Http

Configuration parameters

Name Type Description
credentials string(password) Credentials (key/pair to be replaced in http headers/body/url) e.g.

Operations

delete

Make a http DELETE request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.delete({url = "https://example.com/user/1"})

print(res.status_code)

get

Make a http GET request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.get({url = "https://www.google.com"})

print(res.status_code)

Make a http HEAD request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.head({url = "https://example.com/user/1"})

print(res.status_code)

options

Make a http OPTIONS request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.options({url = "https://example.com/user/1"})

print(res.status_code)

patch

Make a http PATCH request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.patch({url = "https://www.google.com", body="xyz"})

print(res.status_code)

post

Make a http POST request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.post({url = "https://www.google.com", body="xyz"})

print(res.status_code)

put

Make a http PUT request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.put({url = "https://www.google.com", body="xyz"})

print(res.status_code)

request

Make a http request

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
url string Url to make the request against.
body string The raw data to be transmitted. If this is used along with a GET request, the payload will be ignored.
json object Json data to be transmitted, this will set content-type to 'application/json'.
method string Http method for the request
Default: "get"
params object Field-value pairs data, this will be encoded as query string in URL when method is GET, otherwise encoded as name-value pairs in body, in this case content-type will be set as 'application/x-www-form-urlencoded'.
headers object Additional headers to provide in the request.
headers.* string Header value
credentials string Credentials
conn_timeout integer Timeout to establish a connection, in milliseconds, default 3000, maximum 10000
recv_timeout integer Timeout used when receiving a connection, in milliseconds, default 5000, maximum 20000

Responses

Request results retrieved

Content: object The http response to the caller

Name Type Description
body string The body of response
headers object The headers of response
status_code integer The status code of response
##### Required parameters are not provided
Content: nil
Provided parameters are not valid

Content: nil

Example

local res = Http.request({url = "https://www.google.com"})

print(res.status_code)

Last update: April 12, 2021
Back to top