Question

I solved my problem by remove the header name/value: Accept-Encoding: gzip, deflate

I'm using HttpClient class to make request to Facebook. I make to request to facebook.

The first is to homepage: The result is the HTML code of Facebook homepage.

The second is login to facebook ( with headers and request body ): The result of this requert is unreadable. It's "��|ko�Hv���.�c��-��jya[v�n��d�� �D�IJ(�&�����rq� ��_���`�/I��X �o�|���o�s��"

If I login failed, the result must be some readable string. What am I encountering? What should i do to resolve this problem ?

Was it helpful?

Solution

You need to check if the content is gzipped or not and deflate it dynamically. Otherwise, just remove the Accept-Encoding: gzip, deflate as you mentioned in your original question

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top