开发者

differ json from gzipp

I have a follow implementation problem.

I am working with some api and I must upload image file and get result in gzipped format or a JSON error message. How can I differ json and gzipped files with php开发者_如何学Go (I think they are resource type). I have one idea:

call json function to result and if error occured call php die function .

But I don't think it's a best solution.

Thank's


With the Content-Type HTTP response header (but if the API is any good, then if there is an error that will be reflected in the HTTP status code, so you should look there first).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜