GithubHelp home page GithubHelp logo

Comments (4)

jasta avatar jasta commented on April 28, 2024

@bryanstern you can integrate HttpURLConnection using StethoURLConnectionManager. If you depend on okhttp-urlconnection, you can likely make this work pretty easily through subclassing HurlStack. Note that you could probably more easily implement a better OkHttpStack than the one Google provided in Volley. Basically all you'd need is:

public HttpResponse performRequest(...) {
  Response okHttpResponse = mOkHttpClient.newCall(convertToCall(request, params)).execute();
  return convertToApacheResponse(okHttpResponse);
}

from stetho.

bryanstern avatar bryanstern commented on April 28, 2024

@jasta Thanks for suggestion. I ended up just implementing Volley's HttpStack interface and performing the request directly with OkHttp, doing away with okhttp-urlconnection. Once I feel more confident in the code, I'll post that gist up for those interested.

from stetho.

bryanstern avatar bryanstern commented on April 28, 2024

Here is the gist, just set the network interceptor on the OkHttpClient you pass in. https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750

from stetho.

jasta avatar jasta commented on April 28, 2024

@bryanstern closing now that a solution exists. I think if we're going to merge something in it's most likely to be from #51 or something like it which more generically supports Volley.

from stetho.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.