I spent way too much time on this I thought I would share what I found out. I'm surprised I couldn't find this information anywhere as it would seem like something ever app must have.
I expect to be able to send additional data back to the client from my Spring Boot REST API when an error occurs. Something like this:
>curl -i GET https://api.twitter.com/1.1/statuses/update.json?include_entities=true
HTTP/1.1 400 Bad Request
date: Fri, 14 Jul 2023 15:23:34 GMT
content-type: application/json; charset=utf-8
cache-control: no-cache, no-store, max-age=0
content-length: 62
{"errors":[{"code":215,"message":"Bad Authentication data."}]}
I could get this working with curl, but in a browser, the response data was not received. I confirmed this using Google Dev Tools to view the network traffic. And the data was being sent from my REST API.
I would have expected to find some useful information here at one of these links, but I didn't.