1) Give a description of the problem
I’m trying to interact with an external service (that I do not control) using an HTTP POST.
2) What is the expected behaviour?
I POST a request, the service responds with JSON encoded data (I’m pulling a URL from it).
3) What is happening/not happening?
The $response variable is null even though I’m expecting a body. Logging $httpStatusCode confirms I’m receiving a 202 Accepted, which is what I expect after a successful POST based on testing with Postman. $httpContentType comes back as text/json which I think is a bit odd but also correct based on Postman testing.
I think I read somewhere in a thread here that only a 200 response is accepted to populate $response? If that’s the case, I’d suggest that anything in the 200-series response codes should be accepted. Also that even a 400-series response might contain useful information in the returned body that we’d want to capture into $response.