Adding headers to the request

Top  Previous  Next

You can add custom HTTP headers to the HTTP request. HTTP request headers are generally used for sending information about your current session with the HTTP server. Two well-known request headers are the User-Agent header and Cookie header. These headers are used for sending information about your browser version and any cookies that may have been set for the URL you are accessing. Much like an HTTP parameter, an HTTP header consists of a name / value pair.

 

Example

 

// create new HttpRequest

HttpRequest request = new HttpRequest("http://www.myserver.com");

 

// add header

request.addHeader("Time", "10:30");





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC