function
Library: HTTP support (OMHTTP)
Include: omhttp.xin |
define function HttpObjectSetHeader modifiable stream HttpObject for value string HeaderName to value string HeaderValue append value switch AppendMode optional initial {true}
Argument definitions
Use HttpObjectSetHeader to set a named header value in an HTTP request or response object.
You must include the following line at the beginning of your OmniMark program:
include "omhttp.xin"
HttpObjectSetHeader can be called from either a client or a server program.
Set a request and a response header and then retrieve them.
; HttpObjectSetHeader include "omhttp.xin" process local HttpRequest my-Request local HttpResponse my-Response local stream request-Headers variable local stream response-Headers variable HttpObjectSetHeader my-Request for "User-Agent" to "omHTTP" HttpObjectSetHeader my-Response for "Accept" to "*/*" HttpObjectGetHeaders my-Request into request-Headers HttpObjectGetHeaders my-Response into response-Headers output "Request headers:%n" repeat over request-Headers output key of request-Headers || "=%g(request-Headers)%n" again output "Response headers:%n" repeat over response-Headers output key of response-Headers || "=%g(response-Headers)%n" again