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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.