Skip to content
Discussion options

You must be logged in to vote

Hi again. I missed a crucial part of the documentation and I have just found the solution.
For anyone else wondering, it's done by passing 'user-agent' in the instance headers like so:

this.client = got.extend({
    headers: { // This!
        'user-agent': // Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36....
    },
    agent: {
        http: new HttpsProxyAgent(formattedProxy),
    },
    cookieJar: this.jar,
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #2116 on August 24, 2022 07:23.