Request header

The request header is an extra piece of information that is send to the web service. It contains metadata or details needed for executing of the request. You can add 2 types of information.

Name Description
Accept Specify the format of the requested data.
You can choose between:
  • json (application/json)
  • xml (application/xml)
Authorization Specify the username and password via basic authentication.
Remark
  • In the request header you can also specify the parameters instead of in the parameter list of the request url.
In this JavaScript example we specify xml as format and we pass our credentials.
var request = new XMLHttpRequest();
...
request.setRequestHeader("Accept","application/xml");
request.setRequestHeader("Authorization","Basic " + Base64.encode ("User:Password"));
...
In the following JavaScript example we prepare a request to find an article by index 'Number' and value '1'. We want to get the fields 'Number', 'DscLng1', and 'SalesPrice' from the field list 'fields'.
var request = new XMLHttpRequest();
...
request.setRequestHeader("Number", "1");
request.setRequestHeader("Fields", "Number,DscLng1,SalesPrice");
...