Skip to content

Instantly share code, notes, and snippets.

@makeding
Created September 11, 2020 08:25
Show Gist options
  • Save makeding/e5a08b12e0aaba3d59cc9db1a6c19b69 to your computer and use it in GitHub Desktop.
Save makeding/e5a08b12e0aaba3d59cc9db1a6c19b69 to your computer and use it in GitHub Desktop.
let rqtest = (method, url, data, options) => {
uatest(options.ua)
}
let uatest = (ua = false) => {
console.log(ua)
}
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
//ua: 'mobile',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
ua: 'mobile',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
@makeding
Copy link
Author

运行结果

> node test.js
false
mobile
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment