Receiving the Response

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > HTTP >

Receiving the Response

The response to an HTTP request is received in the right-hand pane of the HTTP output window (see screenshot below).

XSHTTPResponse01

To the right of the Body and Headers tab names are listed the following details about the response:

 

The HTTP status code (explained below)
The time from connection made to last response-chunk received
The Content-Type of the response

 

 

The Response pane has two tabs: Body (screenshot below left) and Headers (screenshot below right).

Click to expand/collapse     xshttpresponseheaders_zoom75

Body tab: The body of the response is displayed with syntax coloring if the document is HTML, XML, or JSON, and with line-numbering. The tab has two buttons: (i) Save to File to save the body to a file, and (ii) Create New Document to create a new document in XMLSpy and display the newly created document in the Main Window of the GUI; a newly created document can be edited and saved in the usual way. If a new document cannot be created from the body of the response (for example if the body is an image), then the Create New Document button is disabled (see screenshot further below).
Headers tab: Contains the headers of the response. The Content-Type header is also displayed at the top of the pane.

 

HTTP status codes

Status codes are categorized as follows:

 

2XX codes are used for successful requests.
3XX codes are used for redirects.
4XX codes are used if there was a problem with the request.
5XX codes are used if there was a problem with the server.

 

Some commonly encountered codes:

 

200 OK: Sent in response to a successful request.
206 Partial Content: The server sends only a part of the resource because only a range of the resource was requested.
301 Moved Permanently: The request should be redirected to the given URL.
401 Unauthorized: The resource requires authentication, and authentication has either failed or not been provided.
403 Forbidden: Valid request, but the server is refusing action. This might be because the user does not have the necessary credentials.
404 Not Found: The resource could not be found.
500 Internal Server Error: A generic error message; sent when no more specific message is available.

 

See: A complete list of HTTP status codes.

 

The Accept Header

The Accept header of the request specifies the content type to accept in the response. For example, see the difference between the responses when Accept=image (first screenshot below) and when Accept=image/png (second screenshot below). In the first case, since it is not specified what image format should be sent in the response, an error status code and a JSON message containing more information is sent.

Click to expand/collapse

XSHTTPAcceptImagePNG

 


© 2019 Altova GmbH