Inconsistent content encoding responses

api
encoding

#1

Hi there,

For example, when we send a request to https://ads-api.twitter.com/2/accounts we expect to receive JSON, recently we have started receiving content with the header “Content-Encoding: deflate” at random.

Sometimes the response is JSON, sometimes it is encoded. This behavior happens throughout the ads API endpoints.

Can you help us?

Thanks,
Holly


Invalid content-encoding (deflate) responses
#2

This sounds strange. Do you include an Accept-Encoding: HTTP header on your request? You could try adding Accept-Encoding: None to force plain text JSON to be returned.


#3

Hi @andypiper,

We tried “Accept-Encoding: application/json” but not the value none, “application/json” had no affect

Thanks,
Holly