Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

using LWP user agent and gettting error 1010 for every website i try besides setup api json endpoints, this is the error seen in terminal

HTTP/1.1 403 Forbidden Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate +, post-check=0, pre-check=0 Connection: close Date: Sat, 13 Feb 2021 02:04:56 GMT Server: cloudflare Content-Length: 16 Content-Type: text/plain; charset=UTF-8 Expires: Thu, 01 Jan 1970 00:00:01 GMT CF-RAY: 620afb475bb5f242-ORD Cf-Request-Id: 083abb60980000f242471b1000000001 Client-Date: Sat, 13 Feb 2021 02:04:56 GMT Client-Peer: 104.19.128.108:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /C=US/O=Cloudflare, Inc./CN=Cloudflare Inc ECC + CA-3 Client-SSL-Cert-Subject: /C=US/ST=CA/L=San Francisco/O=Cloudflare, Inc +./CN=sni.cloudflaressl.com Client-SSL-Cipher: TLS_AES_256_GCM_SHA384 Client-SSL-Socket-Class: IO::Socket::SSL Client-SSL-Version: TLSv1_3 Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.c +om/cdn-cgi/beacon/expect-ct" Set-Cookie: __cfduid=d8ad08b4932ed14004949bb070cb4f43f1613181896; expi +res=Mon, 15-Mar-21 02:04:56 GMT; path=/; domain=.4chan.org; HttpOnly; + SameSite=Lax; Secure X-Frame-Options: SAMEORIGIN error code: 1010

This is the exact code im using except url

use LWP::UserAgent; # specify a CA path my $ua = LWP::UserAgent->new(); my $response = HTTP::Request->new(GET => 'https://example.com/'); my $res = $ua->request($response)->as_string; print $res

In reply to LWP::UserAgent throwing 1010 error by throwaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-24 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found