01-13-2009
maintaining form post session using curl
Hello,
I have searched for a good part of the day, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question.
I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no avail:
curl -d username=username -d password=password
http://siteurl/index.php
I then tried this hoping that I could get the session started and then go to the page:
curl -d username=username -d password=password --url
http://siteurl/index.php --url
http://siteurl/desired_page.php
and the same as above using -u username:password instead of -d
I get the pages but I am not logged in. I have tried these methods on other pages using post forms for passwords and it works fine. I have checked to the source of the login pages and I am using the correct name values for password and username. I am trying to download pages that are privy only to members, and I cannot download them
I don't believe the site is using cookies to remember my login info for a session because when I log in and out using firefox, my cookie list does not change.
Does anyone have any ideas what is happing with this?
Last edited by Allasso; 01-14-2009 at 08:19 AM..
Reason: removed auto parsing of URLs and smilies (at least I tried anyway...)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all.
I have an incredible number of servers that I need to change a parameter on using a web interface. I'd like to be able to do this via curl, but I'm having some trouble. I filled out the form and hit update while snooping (tcpdump) my interface. That gave the the following as what is... (0 Replies)
Discussion started by: DeCoTwc
0 Replies
2. Shell Programming and Scripting
I am trying to write a shell script to use curl in order to automate downloading data from a website. The URL with the post form is here: http://try-db.org/de/InfoBySpecies.php .
I have a list of about 1800 different species I want to check. For Example, choose the first species and use the... (2 Replies)
Discussion started by: hansvg
2 Replies
3. Shell Programming and Scripting
Hi All,
I am trying to post an xml file (utf-16 encoded) using curl to a REST service. The REST service is expecting 'multipart/form-data' content type.
curl -k -i -H "Content-Type=multipart/form-data" -F "filename=@file.xml;type=text/xml" -X POST -u <username>:<password> <endPointURL>
... (0 Replies)
Discussion started by: Anooja G
0 Replies
4. Web Development
how to make the bash script ?
http://server.com/mysql.php
POST /mysql.php HTTP/1.1
Host: server.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language:... (1 Reply)
Discussion started by: iddfcr
1 Replies
5. Shell Programming and Scripting
I am trying post SOAP header from file to curl command.
The curl command is
curl -vk -H "$(cat curl-test1.txt)" -X POST https://xvcfvusdgfsd.sdfjd.gf/cmsws/CMSService
The contet of curl file is
POST: https://cmsuat.chrysler.com/cmsusws/CMSService HTTP/1.1
SOAPAction:... (1 Reply)
Discussion started by: dineshaila
1 Replies
6. UNIX for Beginners Questions & Answers
Hello,
I'm new in the forum and really beginer, and also sorry form my bad english.
I use linux and want to create little program to download automaticaly some pdf (invoices) and put in a folder of my computer. I learn how to do and programme with ubuntu but the program will be implemented... (1 Reply)
Discussion started by: MarcelOrMittal
1 Replies
7. Shell Programming and Scripting
i'm using this command to post data to a remote host:
wget --post-data="My Data" http://<my-ip>:80 -O /dev/null -q
and
curl --data "My Data" http://<my-ip>:80
however, when i run the above, i see the following in my access log on the remote host:
Wget:
10.10.10.10 - - "POST /... (1 Reply)
Discussion started by: SkySmart
1 Replies
8. Shell Programming and Scripting
HI All,
i want to asking about my case , how to post content file of data using curl.
currently if i wanna post data file , i can use this command below :
curl --cacert maxaj.cer -X POST -F 'fileupload=@/data/report_3300_xxx/log/traffic_3300_20180319_1051.txt'... (0 Replies)
Discussion started by: fajar_3t3
0 Replies
9. Web Development
I'm having an issue with curl post form, I dont' understand what I'm mising. I would like to send a post command login/password to a form, quite simple in the paper.
URL : http: // <myebsite> / login
Here the form source code :
<form action="/login_check" method="post">
<input... (3 Replies)
Discussion started by: Fred13
3 Replies
10. Web Development
Hi,
I write a new thread to discuss about my closed topic with new information ( /280990-curl-post-form-issue.html )
The previous post was closed because of missing informations, I didn't have access yet to server logs.
----------------------------------------------------------------------... (4 Replies)
Discussion started by: Fred13
4 Replies
LEARN ABOUT DEBIAN
authen::simple::http
Authen::Simple::HTTP(3pm) User Contributed Perl Documentation Authen::Simple::HTTP(3pm)
NAME
Authen::Simple::HTTP - Simple HTTP authentication
SYNOPSIS
use Authen::Simple::HTTP;
my $http = Authen::Simple::HTTP->new(
url => 'http://www.host.com/protected'
);
if ( $http->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::HTTP
PerlSetVar AuthenSimpleHTTP_url "http://www.host.com/protected"
<Location /protected>
PerlAuthenHandler Authen::Simple::HTTP
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
DESCRIPTION
Authenticate against an HTTP server.
METHODS
* new
This method takes a hash of parameters. The following options are valid:
* url Url to authenticate against. Required.
url => 'http://www.host.com/protected'
* agent Any object that is a subclass of LWP::UserAgent.
agent => LWP::UserAgent->new;
* log Any object that supports "debug", "info", "error" and "warn".
log => Log::Log4perl->get_logger('Authen::Simple::HTTP')
* authenticate( $username, $password )
Returns true on success and false on failure.
SEE ALSO
Authen::Simple.
LWP::UserAgent.
LWPx::ParanoidAgent.
AUTHOR
Christian Hansen "ch@ngmedia.com"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-03-01 Authen::Simple::HTTP(3pm)