Perl: Value of response code in HTTP::Request -
So, I'm writing a code to get a document from the Internet. The size of the document is approximately 200 KB. This code is:
#! / Usr / local / bin / perl -w stringent experiment; Use LWP :: UserAgent; My $ ua = LWP: UserAgeent-> New; My $ url = "some url"; My $ req = HTTP :: Request-> New (GET = & gt; $ url); My $ res = $ ua- & gt; Request ($ req); If ($ res-> is_success) {print $ res-> material. "\ N"; } And {print} "Error:" $ Res-> Status_line; }
Now, the only problem is that I can not mention what the URL is.
However, the output is: "Error: 500 time to read" When I checked the link externally, the data is being downloaded within 5 seconds.
I have also changed 1000s to finish the time, but it still does not work. How should I go about finding more information related to the reaction? The size of the file (about 200 kb) is not enough to provide a time-guarantee of reading. The server is not too busy, whenever I checked the link on the browser there was no problem.
Thank you.
Ensure that the webserver is not configured to drop requests from Perl in this case.
Comments
Post a Comment