Code Monkey home page Code Monkey logo

Comments (14)

hram avatar hram commented on June 6, 2024 3

you can setup http client
//optionally
.client(your_okhttp_client)

from rxretrojsoup.

hram avatar hram commented on June 6, 2024 1

@yishangfei with test https://stackoverflow.com/a/27840834

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

i know okhttp setUser-Agent success
Because okhttp need to set a url succeed ,RxRetroJsoup also need to set a url RxRetroJsoup print display did not succeed @hram

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

hi What is a good way @hram
image

image

image

from rxretrojsoup.

hram avatar hram commented on June 6, 2024

But you do not setup okhttp client in second example

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

sorry
image
Wrote the same as before you set the User-Agent?
@hram

from rxretrojsoup.

hram avatar hram commented on June 6, 2024

Now you can set interceptor for okhttp and in this one set user agent

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

Did not understand, I set up in the RxRetroJsoup OKhttp client or not, whether you have done before the user agent,Is there a demo?
This question bothers me for a long time~

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

@hram hlep me~

from rxretrojsoup.

hram avatar hram commented on June 6, 2024

you can create custom interceptor for okhttp

public class SomeInterceptor implements Interceptor {

    @Override
    public Response intercept(Interceptor.Chain chain) throws IOException {
        Response originalResponse = chain.proceed(chain.request());
        return originalResponse.newBuilder().header("Accept-Language", "some_header_parametr").build();
    }
}

and add this one to okkhttp

OkHttpClient.Builder builder = new OkHttpClient.Builder().addNetworkInterceptor(new SomeInterceptor());

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

activity is it written like this?
image

@hram

from rxretrojsoup.

hram avatar hram commented on June 6, 2024

@yishangfei
client

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

image
image
Or do not have access to the computer version of the link ~ OMG

from rxretrojsoup.

yishangfei avatar yishangfei commented on June 6, 2024

you konw okhttp set cookie?

from rxretrojsoup.

Related Issues (19)

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.