-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Action - Send web request
-
Minor
Issue Summary
When sending web-request functionality to GET information back, if we receive the following response header back from a web request, the response body is coerced into a string instead of a proper object type.
Unsupported Content-Type:
Content-Type: application/vnd.api+json
Steps to Reproduce
- You could create any mock response using public websites such as https://apimocha.com/
- Ensure that the response header Content-Type is set as follows:
Content-Type: application/vnd.api+json
- When printing webResponse.body, it will show the response, but as a string.
- If you try to access any reference such as webResponse.body.id, nothing is returned.
Expected Results
The JSON being returned should be an object typed into the smart value webResponse.
Actual Results
The webResponse is not being treated as json object, so it is not able to get any values from the object.
Workaround
The ideal scenario would be to use the broadly used Content-Type headers as application/json.
If not, we could use a substringBetween function to retrieve some values. Example below:
{{webResponse.body.substringBetween("id\":", ",")}}
While we don't have AUTO-138 resolved, it would there is no other workaround.