<p><a href="https://i.stack.imgur.com/I29CN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I29CN.png" alt="enter image description here"></a></p>

<p><em>Access Denied 403.</em>
Sadly, your client does not supply a proper User-Agent and is consequently excluded.</p>

<p>to fix this pass User-Agent in request headers</p>

<pre><code>var options = {
    url: 'https://arxiv.org/pdf/1611.10012.pdf',
    headers: {
        'Referer': 'https://arxiv.org',
        'User-Agent': 'stagefright/1.2 (Linux;Android 5.0)'
    }
}

request(options, function (error, response, body) {
  console.log('error:', error);
  console.log('statusCode:', response &amp;&amp; response.statusCode);
  console.log('body:', body);
});
</code></pre>

<p>List of user agents for User Agent <a href="https://gist.github.com/enginnr/ed572cf5c324ad04ff2e" rel="nofollow noreferrer">https://gist.github.com/enginnr/ed572cf5c324ad04ff2e</a></p>
request mothod not working for https://arxiv.org pdf files
<p>I am using request method for get the file stream, its works for all pdf files but when i try to get <a href="https://arxiv.org" rel="nofollow noreferrer">https://arxiv.org</a> website pdfs (<a href="https://arxiv.org/pdf/1611.10012.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1611.10012.pdf</a>) then its not working. </p>

<p>For <a href="https://arxiv.org/" rel="nofollow noreferrer">https://arxiv.org/</a> website pdfs its giving 403 fobidden status code whereas for other websites pdf files it return 200 status code.</p>

<p>Here is my code for getting other website pdfs</p>

<pre><code>   request('http://uberthings.com/mobile/intro_to_mobile.pdf', function (error, response, body) {
  console.log('error:', error); 
  console.log('statusCode:', response &amp;&amp; response.statusCode); 
  console.log('body:', body);
});
</code></pre>

<p>// Return 200 status code</p>

<p>Here is my code for <a href="https://arxiv.org" rel="nofollow noreferrer">https://arxiv.org</a> other website pdfs</p>

<pre><code>  request('https://arxiv.org/pdf/1611.10012.pdf', function (error, response, body) {
  console.log('error:', error); 
  console.log('statusCode:', response &amp;&amp; response.statusCode); 
  console.log('body:', body);
});
</code></pre>

<p>// Return 403 status code</p>

<p>Any Idea why request method for particular website (<a href="https://arxiv.org/pdf/1611.10012.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1611.10012.pdf</a>) is not working ?</p>