Skip to content
Advertisement

Cache-Control : no-cache

I tried to build an app in android studio which does json parsing from a URL server with ports (example: http://xxx.xxx.xxx.xxx:xxxx). So I found 3 methods such as asynctask, volley and okhttp. But the problem is everytime I parse it with these methods, the same exception always occurred.

java.net.ProtocalException: Unexpected status line: HTTP/1.1 Cache-Control:no-cache

Here is my code

JavaScript

So is there any method to do this parsing? Or any solution?

Advertisement

Answer

Okay so apparently the problem was not with the code I am using, but the server API’s responses. The server didn’t response when I hit the API but now it’s working perfectly fine!

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement