Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically decode response based on the content-type header #26

Closed
nealio82 opened this issue Apr 1, 2016 · 1 comment
Closed

Automatically decode response based on the content-type header #26

nealio82 opened this issue Apr 1, 2016 · 1 comment
Assignees

Comments

@nealio82
Copy link
Contributor

nealio82 commented Apr 1, 2016

Because this is better than using string functions to work out the response format

@nealio82
Copy link
Contributor Author

nealio82 commented Apr 1, 2016

Also, when response is in CSV format, there is a bug causing exceptions when the default response decoder is used

Notice: Undefined offset: 2
500 Internal Server Error - ContextErrorException
Stack Trace

    in src/Mediamath/src/MediaMath/TerminalOneAPI/Decoder/DefaultResponseDecoder.php at line 45  -
                preg_match('/("meta"\ ?\:\ ?)(\{(.)+?\})/s', $api_response, $meta);
                $meta = new ApiResponseMeta(json_decode($meta[2], true));
                return new ApiResponse($meta, $api_response);

@nealio82 nealio82 self-assigned this Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant