Http Request Headers

For methods that have an HttpRequest object argument, the request information (headers, path, verb such as GET/PUT/POST, etc.) all come from the HttpRequest object.
For example:

public HttpResponse PostUrlEncoded(string url, HttpRequest req);
public HttpResponse SynchronousRequest(string domain, int port, bool ssl, HttpRequest req);

But for methods that don’t have an HttpRequest argument, the HTTP request information comes from the method arguments
and the Http object itself.   For example:

    public HttpResponse PostJson2(string url, string contentType, string jsonText);

You could do PostJson2 with headers like this:

    http.SetRequestHeader(“ReportName”,reportName);
http.SetRequestHeader(“UserName”,userName);

http.PostJson2(……);

However, the headers you set in the Http object are sent for all methods that don’t have an HttpRequest argument.
You could then clear the Http object headers by calling

http.ClearHeaders();