client:do_request

March 26, 2020 Contributors

Name

client:do_request — Perform an HTTP request

Synopsis

require('msys.http.client')

client:do_request(type, url, data);

type: string
url: string
data: string (optional)

Description

Perform an HTTP request. The legal values for the type parameter are as follows:

  • GET

  • POST

  • PUT

  • DELETE

The url parameter defines the URL that will process the request.

The data parameter does not need to be provided when type is GET.

function httpclient_test_post(url, postdata)
  client:set_header("Content-Type: text/xml; charset=utf-8");
  client:do_request("POST", url, postdata);
end

See Also

msys.http.client.new, client:set_timeout, client:set_header, client:get_status, client:get_body, client:parse_headers client:get_headers