Adding custom Http Headers with AddHttpHeader() and ClearHttpHeaders()

In rare situations you may have to add custom HTTP Headers to a request because the service or a router requires these headers for access. In order to provide at least some minimal access to HTTP behavior an AddHeader() method is exposed on the .NET Proxy class generated which in the FoxPro Proxy is available as two methods:

loProxy.oService.AddHttpHeader("CustomHeader","value")
loProxy.oService.ClearHttpHeaders()

Note: These methods are generated on the .NET proxy (loProxy.oService).

These two methods operate on a collection of headers that you can specify and add to a request. Note that headers added are assigned to every request that follows, so if you need to use headers only for a single request make sure to call ClearHeaders() to clear out any custom headers before the next request.


© West Wind Technologies, 2004-2020 • Updated: 09/29/15
Comment or report problem with topic