Skip to main content

Name

client:set_header — Set an HTTP header

Synopsis

require('msys.http.client')

client:set_header(header);

header: string (optional)

Description

Set a client's HTTP header. To set multiple headers, invoke this function multiple times. Calling this function with no arguments will clear the headers.

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

Was this page helpful?