Sponsored Content
Full Discussion: Using curl in commandline
Top Forums Shell Programming and Scripting Using curl in commandline Post 302421027 by manishmaha on Thursday 13th of May 2010 08:07:20 AM
Old 05-13-2010
Using curl in commandline

Hi,

I am using curl to hit a url using http in solaris 10 using commandline, I want to transfer an attachment(using multipart curl -F) also as a part of the request. If anyone has used kindly help me with the syntax. I am using below command:

Code:
/usr/local/bin/curl -v http://153.88.xxx.xx:80/AttachmentHandler/inboundAttachmentProcessor.aspx -A "Jakarta Commons-HttpClient/3.0" --header "Accept: text/xml" -H "Content-Type: multipart/related; type=text/xml" -f "file=mm.xml"

When I use below, I get succesful result but with above command I get "Root element is missing", as I need to send multipart content(i.e. an attachment as well) so I want to use -F option, also let me know how to send attachment also.

Code:
/usr/local/bin/curl -v http://153.88.xxx.xx:80/AttachmentHandler/inboundAttachmentProcessor.aspx -A "Jakarta Commons-HttpClient/3.0"
 --header "Accept: text/xml" -H "Content-Type: multipart/related; type=text/xml" -d "@mm.xml"

Many Thanks!!


Best Regards,
Mohit


Moderator's Comments:
Mod Comment Added code tags.

Last edited by radoulov; 05-13-2010 at 09:16 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell and commandline interpreter-definitions

What is the difference between the(a) shell and the (a) command-line interpreter? Here we're talking about the complete dummy question, but could someone point me right. (yes, have written scripts in for instance bash shell, and and grepp-ed my way around ....:eek: (4 Replies)
Discussion started by: amkgw
4 Replies

2. UNIX for Dummies Questions & Answers

list only directories in commandline.

I want to list only directories in the command line using ls command. Can anyone please help me. (9 Replies)
Discussion started by: jhmr7
9 Replies

3. Shell Programming and Scripting

Validating commandline argument

Hi, I am calling a script script2.shl from script1.shl as below script2.shl "TABLE_NAME" -r 10 In that I have to validate the parameter 4. i.e : it should be only 10 20 30 40 50 I know that I can do it by checking like below if ]; then echo "TRUE" else echo "FALSE" fi ... (3 Replies)
Discussion started by: mr_manii
3 Replies

4. Shell Programming and Scripting

$OPTARG changes commandline input

Hi there, I hope, that I do not open an thread, that is already existing, but I didn't found something matching with my problem while searching for problems with "getopts" My problem ist, that I'm taking arguments from commandline into my script with getopts, I've an flag -s, after that there... (2 Replies)
Discussion started by: thommes_pommes
2 Replies

5. Shell Programming and Scripting

Multiple commandline switches

I have a script that has commandline switches that work no problem. But i don't know how to enable it to have multiple switches at one time. So I'd want myscript -h -o or even myscript -ho but i'm having no luck incorporating this. I tried shifting but i'm not getting it. Thanks ----------... (0 Replies)
Discussion started by: DC Slick
0 Replies

6. Shell Programming and Scripting

AWK Script and Commandline difference

Hey there, I just stumbled upon a difference between using awk on the commandline and using it in a shellscript. I have a variable, e.g.: PROG=vim then i want to check if the package with this name is installed: TEMPVAL=$(dpkg -l | awk '{ if ($2 == "$PROG") print $2 }') (Im using... (10 Replies)
Discussion started by: MrSnail
10 Replies

7. OS X (Apple)

Opening Applications from the commandline

as you probably/may know, one can open any application from the application folder with the command open -a program_name I found that out today and so I created aliases in .bash_profile and they work. alias safari="open -a safari" alias gimp="open -a gimp" alias seamonkey="open -a... (0 Replies)
Discussion started by: butterbaerchen
0 Replies

8. Shell Programming and Scripting

Checking commandline

mymk target How to check is on commandline or no? Cannot to find out ;( Know that I need to use if.....new in shell sorry Please use code tags next time for your code and data. (2 Replies)
Discussion started by: Manueldo
2 Replies

9. UNIX for Dummies Questions & Answers

Load config file at commandline

Hello, This would be very basic question to most of you, but for me as a newbie it is an un-know. I would like to load a configuration file into memory before executing a specific command. For example: I have a config file that holds all the database connectivity information and I'd like to... (5 Replies)
Discussion started by: babyPen1985
5 Replies
CURLOPT_TCP_KEEPINTVL(3)				     curl_easy_setopt options					  CURLOPT_TCP_KEEPINTVL(3)

NAME
CURLOPT_TCP_KEEPINTVL - set TCP keep-alive interval SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPINTVL, long interval); DESCRIPTION
Pass a long. Sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems support this option. (Added in 7.25.0) DEFAULT
60 PROTOCOLS
All EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* enable TCP keep-alive for this transfer */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L); /* set keep-alive idle time to 120 seconds */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L); /* interval time between keep-alive probes: 60 seconds */ curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L); curl_easy_perform(curl); } AVAILABILITY
Always RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_TCP_KEEPALIVE(3), CURLOPT_TCP_KEEPIDLE(3), libcurl 7.54.0 January 02, 2017 CURLOPT_TCP_KEEPINTVL(3)
All times are GMT -4. The time now is 05:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy