0

Hi Guys I am using Stethofacebooklibrary with okhttp to debug and intercept http calls, it seems a pretty smooth ride except that for a few GET calls the dev tool in unable to show the JSON response and also shows those calls as "Pending" though the status for such calls is 200 OK and also the response headers are logged.

For other calls I am able to see them as excepted in network tab of chrome dev tools , but for certain url i get PENDING, although data has already arrived (data format is JSON) , i am able to log the data in application by adding log comments for such PENDING state calls so data definitely comes and its not malformed in any way, has anybody else faced this or can think of why chrome dev tools / stetho gave up on me ?

This is how i am using stetho in my code gradle entry :

compile 'com.facebook.stetho:stetho-okhttp:1.3.1'
compile 'com.squareup.okhttp:okhttp:2.4.0'

In my application file in onCreate()

 Stetho.initializeWithDefaults(this);

And i attach okhttp client with stetho as

 OkHttpClient client = new HttpClient();
 client.networkInterceptors().add(new StethoInterceptor());

I tried running the inspect tool after disabling all the extension (adblock etc)

I am adding screenshot of the dev tools and also a detail of one of the network which is in pending state but says 200 OK along with response headers including content length with non zero values but size shows as 0.Also adding screen shot for a successful response entry where the content length was small. Chrome Dev tool network screenshot , few GET calls are pending state although the status is 200 ok Successful call to the endpoint with dummy param which respond with dummy response of small length 32bytesActual call to the enpoint with real param which result in a  longer response which  shows as pending and size as zero although the status is 200 ok and content length show the size of response

amIT
  • 664
  • 13
  • 27
  • It could be that you have an extension, such as Adblock (seen in your screesnhot), which is interfering with your requests. See if disabling extensions has an affect. You have 5 GET requests for JSON content. Are they for different resources? It's not so clear as you obviously wanted to hide your data. – Gideon Pyzer Aug 10 '16 at 09:22
  • @Gideon yes the url i can reveal but yes all the pending GET call are call to same url , the last GET call is to different url which shows properly. let me try disabling all my extension and try again. Thanks – amIT Aug 10 '16 at 13:02
  • Running in a new Chrome profile will be the best way to rule out 3rd party issues, such as plugins, caches and settings. – Gideon Pyzer Aug 10 '16 at 13:06
  • @Gideon tired both but same almost same result , when hit the url with params such that the response content length is samll it logs properly but ususally my content length for response is between 10 k - 100k for such request still show in pending state. and even the size of respone is 0 althoutgh the content length header states other wise < attaching new set of screen shots). btw my okhttp is 2.4.0 – amIT Aug 10 '16 at 13:18

0 Answers0