LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-03-2012, 02:55 PM   #1
markseger
Member
 
Registered: Jul 2003
Posts: 244

Rep: Reputation: 26
How to PUT a file with perl LWP


I recently discovered LWP and while the documetation is pretty clear on some things, I'm also finding it lacking in others. Perhaps the problem is http is so extensive you can't document everything and have to let the user rely of getting the details elsewhere.

That said, I'm trying to PUT a file to a web server that is set up to receive one via a REST interface. One first authenticates oneself, gets a token and uses that token with the PUT. I've done this in bash curl, so know I'm doing it correctly.

Using LWP I managed to GET a token and build a put request, so I'm at least using some of the functions correctly. In fact, my first PUT try I got an authentication error and once I got my request formatted correctly the authenticate error went away so I think I'm real close. However the request still fails and therein lies my question - how/where do you specify the data portion of a PUT request? I'm guessing you build an in memory string of data and pass it as a reference, but I have no idea how.

As a curiosity I looked at the source for UserAgent.pm and founds subs for get and post, but no put! Clearly I'm missing something.

-mark
 
Old 12-03-2012, 03:58 PM   #2
markseger
Member
 
Registered: Jul 2003
Posts: 244

Original Poster
Rep: Reputation: 26
I finally figured it out. Once again, O'Reilly to the rescue: http://oreilly.com/openbook/webclient/ch05.html#42247
-mark
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interacting with a website using Perl and LWP saldon Programming 2 05-09-2011 09:27 AM
Perl with LWP and NTLM wondergirl Programming 3 05-22-2010 02:32 PM
Perl Error LWP/Simple.pm netpumber Slackware 11 12-18-2008 12:06 AM
Perl install LWP module ; problems ... danran Programming 5 05-03-2007 01:02 PM
Perl's LWP to Python?? chutsu Programming 3 06-05-2006 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration