# Accept header vs error body (profile: advice, jackson-dataformat-xml on the classpath)

## A successful response, for comparison
$ curl -H "Accept: application/xml" /orders/1
HTTP/1.1 200 
Content-Type: application/xml;charset=UTF-8
<Order><id>1</id><sku>SKU-1</sku><quantity>2</quantity></Order>

## Accept: application/json
$ curl -H "Accept: application/json" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+json
{"detail":"Order 999 does not exist","instance":"/orders/999","status":404,"title":"Order not found","type":"https://ankurm.com/problems/order-not-found","orderId":999}

## Accept: application/xml
$ curl -H "Accept: application/xml" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+json
{"detail":"Order 999 does not exist","instance":"/orders/999","status":404,"title":"Order not found","type":"https://ankurm.com/problems/order-not-found","orderId":999}

## Accept: application/problem+xml
$ curl -H "Accept: application/problem+xml" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+xml
<problem xmlns="urn:ietf:rfc:7807"><detail>Order 999 does not exist</detail><instance>/orders/999</instance><status>404</status><title>Order not found</title><type>https://ankurm.com/problems/order-not-found</type><orderId>999</orderId></problem>

## Accept: text/html
$ curl -H "Accept: text/html" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+json
{"detail":"Order 999 does not exist","instance":"/orders/999","status":404,"title":"Order not found","type":"https://ankurm.com/problems/order-not-found","orderId":999}

## Accept: image/png
$ curl -H "Accept: image/png" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+json
{"detail":"Order 999 does not exist","instance":"/orders/999","status":404,"title":"Order not found","type":"https://ankurm.com/problems/order-not-found","orderId":999}

## Accept: */*
$ curl -H "Accept: */*" /orders/999
HTTP/1.1 404 
Content-Type: application/problem+json
{"detail":"Order 999 does not exist","instance":"/orders/999","status":404,"title":"Order not found","type":"https://ankurm.com/problems/order-not-found","orderId":999}

