Sponsored Content
Top Forums Shell Programming and Scripting Using CURL command with special characters in URL Post 303009743 by kumarjt on Tuesday 19th of December 2017 10:21:36 AM
Old 12-19-2017
Thanks all. The command worked with enclosing the URL with double quotes and it worked.

Regards
Kumarjit
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

apache encode special characters in URL

Hi all, How can I enable encoding of special characters present in URL? eg If the URL is http://127.0.0.1/test.cgi?param1=test & test co it shouldbe encoded to http://127.0.0.1/test.cgi?param1=test%20%26%20test%20co Thanks and Reagards, uttam hoode (3 Replies)
Discussion started by: uttamhoode
3 Replies

2. Shell Programming and Scripting

bash curl escape & in url

I'm running a curl command in bash, but the & in the middle causes the second half of the line to run in the background, here's what I'm trying to do: lat="37.451" lon="-122.18" url="http://ws.geonames.org/findNearestAddress?lat=$lat&lng=$lon" curl -s "$url" I tried escaping the & with \&,... (4 Replies)
Discussion started by: unclecameron
4 Replies

3. Shell Programming and Scripting

Special characters in command arguments

Hey Guys, I have a program that populates a database based on input I feed it. so it would look like: cmd arg1 arg2 ... argN Now some of the arguments have special characters in them so I wrote a small script to pull the args and wrap them in quotes ('arg'). The problem is sometimes... (10 Replies)
Discussion started by: aaron0001
10 Replies

4. Shell Programming and Scripting

Downloading of dynamically generated URL using curl and sed

I've been attempting to use curl and sed to allow for downloading a file from a dynamically generated URL. I've been able to retrieve and save the HTML of the page that does the dynamic generation of the download URL using curl but I'm very new to sed and I seem to be stuck at this part. HTML: ... (1 Reply)
Discussion started by: schwein
1 Replies

5. UNIX for Dummies Questions & Answers

Launch a URL,validate username and password using wget or curl

Hi All, I want to launch "ex: http://gmail.com" from the cmd window and validate the credentials with username and password, is it possible? I have found something like this "wget --http-user=USER' --http-password=PASSWORD http://gmail.com" am new to this and unable to find a solution, i... (0 Replies)
Discussion started by: harsha85
0 Replies

6. Shell Programming and Scripting

A test command parameter is not valid, when special characters are tried to match

Hi I have a scenario where hyphen(-) from file should be ignored I used the following code if && ; then if ; then pow=$LINE echo $pow > history.txt flag=1 fi fi I get the following output ./valid.sh: -: 0403-012 A test... (7 Replies)
Discussion started by: Priya Amaresh
7 Replies

7. UNIX for Dummies Questions & Answers

Read URL data from UNIX without wget,curl,lynx,w3m.

Hi Experts, Problem statement : We have an URL for which we need to read the data and get parsed inside the shell scripts. My Aix has very limited perl utility, i cant install any utility as well. Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled... (0 Replies)
Discussion started by: scott_cog
0 Replies

8. Shell Programming and Scripting

Read URL data from UNIX-CLI without Wget,CURL,w3m,LWP

Hi Experts, Problem statement : We have an URL for which we need to read the data and get parsed inside the shell scripts.My Aix has very limited perl utility, i cant install any utility as well. Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled it.... (12 Replies)
Discussion started by: scott_cog
12 Replies

9. 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

10. Shell Programming and Scripting

Tcsh script - sed command for special characters

Hi, I am using sed command to replace following line in gz file- sed -n 's/""COS_12_TM_1" ( 1101110101001001010011110100000010110100010010000000100000000010XX010000000 )"/""COS_12_TM_1" ( 110111010100100101001111MM00000010110100010010000000100000000010XX010000000 )"/g' filename.gz $x=... (4 Replies)
Discussion started by: Preeti Chandra
4 Replies
CURLOPT_DEFAULT_PROTOCOL(3)				     curl_easy_setopt options				       CURLOPT_DEFAULT_PROTOCOL(3)

NAME
CURLOPT_DEFAULT_PROTOCOL - default protocol to use if the URL is missing a scheme name SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DEFAULT_PROTOCOL, char *protocol); DESCRIPTION
This option tells libcurl to use protocol if the URL is missing a scheme name. Use one of these protocol (scheme) names: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp An unknown or unsupported protocol causes error CURLE_UNSUPPORTED_PROTOCOL when libcurl parses a schemeless URL. Parsing happens when curl_easy_perform(3) or curl_multi_perform(3) is called. The protocols supported by libcurl will vary depending on how it was built. Use curl_version_info(3) if you need a list of protocol names supported by the build of libcurl that you are using. This option does not change the default proxy protocol (http). Without this option libcurl would make a guess based on the host, see CURLOPT_URL(3) for details. The application does not have to keep the string around after setting this option. DEFAULT
NULL (make a guess based on the host) PROTOCOLS
All EXAMPLE
curl = curl_easy_init(); if(curl) { /* set a URL without a scheme */ curl_easy_setopt(curl, CURLOPT_URL, "example.com"); /* set the default protocol (scheme) for schemeless URLs */ curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); /* Perform the request */ curl_easy_perform(curl); } AVAILABILITY
Added in 7.45.0 RETURN VALUE
CURLE_OK if the option is supported. CURLE_OUT_OF_MEMORY if there was insufficient heap space. CURLE_UNKNOWN_OPTION if the option is not supported. SEE ALSO
CURLOPT_URL(3), libcurl 7.54.0 December 21, 2016 CURLOPT_DEFAULT_PROTOCOL(3)
All times are GMT -4. The time now is 11:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy