Curl login to web page


 
Thread Tools Search this Thread
Operating Systems Linux Curl login to web page
# 1  
Old 01-06-2017
Curl login to web page

Hello dears,
I am trying to log in the website using curl but no luck so far.
The web page Content-Type is : text/html;charset=ISO-8859-1

I try the following command using curl:

Code:
curl \
--header "Content-type: text/html" \
--request POST \
--data '{"user": "someusername", "password":somepassword}' http://someweb.com/login.htm

What happens is that it just dumps the web page source code. It even does not try to authenticate.

Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get contents of php page using curl in C language?

Hi, I want to write code in C using curl library to get output of php page , the output is in xml. Thanks (2 Replies)
Discussion started by: nitks.abhinav
2 Replies

2. UNIX for Beginners Questions & Answers

How to use cURL to download web page with authentification (form)?

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

3. Shell Programming and Scripting

Use curl to send a static xml file using url encoding to a web page using pos

Hi I am try to use curl to send a static xml file using url encoding to a web page using post. This has to go through a particular port on our firewall as well. This is my first exposure to curl and am not having much success, so any help you can supply, or point me in the right direction would be... (1 Reply)
Discussion started by: Paul Walker
1 Replies

4. Shell Programming and Scripting

help pulling ${VARS} out of a web page user curl

Here is the code I have so far #!/bin/bash INFOF="/tmp/mac.info" curl --silent http://www.everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-2-duo-2.8-aluminum-17-mid-2009-unibody-specs.html "$INFOF" I want help putting these specs into a vars Standard Ram: value into $VAR1... (1 Reply)
Discussion started by: briandanielz
1 Replies

5. Shell Programming and Scripting

Grabbin a html code from a page (Var = Curl)

Hi there. Im not very good on shell yet. This line, will print me YES or NO in console. Its the HTML code returned from the website, simply YES or NO curl -L "http://www.thewebsite.net/auth/log.jsp?user=$user&sessionId=$sid&serverId=$hash" How could i save this into a variable, so i... (1 Reply)
Discussion started by: Ziden
1 Replies

6. Shell Programming and Scripting

web service call: curl output to xsltproc input

I need to invoke a web service and extract what I need from the response using a combination of curl and xsltproc. However, any file-based parameters that must be supplied to both these programs must be from stdin and not actual files. At least with curl, it seems to think that I am supplying a... (3 Replies)
Discussion started by: webuser
3 Replies

7. UNIX and Linux Applications

How to redirect to squid login web page when internet access

Hi , I am new user. As you know when acl is defined in /etc/squid/squid.conf file according to its http_access users are able to access internet. Before that .htaccess asks them to access internet. It is fine. I saw in some customised linux servers in place of .htaccess login ,html web page... (1 Reply)
Discussion started by: sandeepvson
1 Replies

8. UNIX for Dummies Questions & Answers

curl command with web pages

I can't quite seem to understand what the curl command does with a web address. I tried this: curl O'Reilly Media: Tech Books, Conferences, Courses, News but I just got the first few lines of a web page, and it's nowhere on my machine. Can someone elaborate? (2 Replies)
Discussion started by: Straitsfan
2 Replies

9. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

10. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies
Login or Register to Ask a Question
CURLOPT_MAXREDIRS(3)					     curl_easy_setopt options					      CURLOPT_MAXREDIRS(3)

NAME
CURLOPT_MAXREDIRS - maximum number of redirects allowed SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXREDIRS, long amount); DESCRIPTION
Pass a long. The set number will be the redirection limit amount. If that many redirections have been followed, the next redirect will cause an error (CURLE_TOO_MANY_REDIRECTS). This option only makes sense if the CURLOPT_FOLLOWLOCATION(3) is used at the same time. Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite number of redirects. DEFAULT
-1, unlimited PROTOCOLS
HTTP(S) EXAMPLE
curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/"); /* enable redirect following */ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); /* allow three redirects */ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 3L); /* Perform the request */ curl_easy_perform(curl); } AVAILABILITY
Along with HTTP RETURN VALUE
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_FOLLOWLOCATION(3), libcurl 7.54.0 February 03, 2016 CURLOPT_MAXREDIRS(3)