Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

Responses are generally made up of three components. The net.http.* API returns responses in these three parts so you can handle the responses appropriately:

 1) HTTP Status Code

The status includes standardized codes and messages for certain request outcomes. When working with web services you’ll commonly see:

  • 2XX Success: The request was successful (e.g., 200 OK, 201 Created).

  • 4XX Client errors: The request contains incorrect syntax or cannot be fulfilled (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found).

  • 5XX Server errors: The server failed to fulfill a valid request (e.g, 503 Service Unavailable).

In the above screenshot, the status code of 201 means resource was successfully created.

 2) Header

The header contains information about the response - this doesn’t actually contain the response itself. A response header table is returned where you can access information about the response.

 3) Body

The body is the content of the response. It contains the information we want to use based on the request we made.

It can be information you need to use, for example, the access token or resource you requested from the server or an error description providing you specific details why the server could not process your particular request. 

In this case, the FHIR Server returned the successfully created resource:

  • No labels