Issue in Curl to send http POST request with attachment/multipart


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Issue in Curl to send http POST request with attachment/multipart
# 1  
Old 05-19-2010
Issue in Curl to send http POST request with attachment/multipart

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/AttachmentHa...Processor.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/AttachmentHa...Processor.aspx -A "Jakarta Commons-HttpClient/3.0"
--header "Accept: text/xml" -H "Content-Type: multipart/related; type=text/xml" -d "@mm.xml"
# 2  
Old 05-19-2010
Double post, continued here, thread closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Curl - post form issue

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

2. Shell Programming and Scripting

Construct and Send Multipart MIME Mail

Hi, I have requirment in shell script to incorporate multipart email with both html and text. Here am giving the text version. From: any@email.com To: your@email.com Subject: Success Execution - $company - Apps PO File Report Apps PO File Report Summary: #APPS Purchase... (2 Replies)
Discussion started by: kirankumar
2 Replies

3. Shell Programming and Scripting

Curl Script - Post a file (multipart/form-data)

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. Shell Programming and Scripting

Parsing the http post request

Hi, I am trying to write a shell script to parse the post request data that it received to a xml file. Below is the post request data that script is receiving. -----------------------------7dd2339190c8e Content-Disposition: form-data; name="param1" 1... (2 Replies)
Discussion started by: jdp
2 Replies

5. Shell Programming and Scripting

http request

I am running a website but I still have problems with the "service temporarily unavailable error". I want to make a simple check if the website is up and running. Does anybody has an idea how to do it? (the site is password protected, so you have to add a user and pwd before logging in). ... (2 Replies)
Discussion started by: jurgen
2 Replies

6. UNIX for Advanced & Expert Users

Syntax issue in curl for getting a file from http site

Hi All I am using curl in my client environment. We need to pull a file from the libraries site. All the files are having perticular URL which can be used to get the files. Only issue is, when we fire that command , it will take to authentication page 1st. once authentication is succed, it will... (1 Reply)
Discussion started by: prabirkumardhar
1 Replies

7. Shell Programming and Scripting

How to send XML data using HTTP Post Request

How to hit HTTP Post Request along with sending XML data to a Remote server through command line utility like wget (or anything else). (0 Replies)
Discussion started by: sandeep reddy
0 Replies

8. UNIX for Dummies Questions & Answers

How to send a Head Http request from command line

Ok. I'm testing a new program component that is supposed to speed up our pipeline on the server. What it does is take in HEAD requests and shuffle them off to a different pipeline that is specially designed to handle HEAD requests quickly. The functionality works but now comes the question: how... (3 Replies)
Discussion started by: darkling235
3 Replies

9. UNIX for Dummies Questions & Answers

HTTP request

Can anybody tell about http request processing in shell script..? (3 Replies)
Discussion started by: noufal
3 Replies

10. Shell Programming and Scripting

Http request in Linux

Hi, i need a guide how to write a script which i can do a http request. Let say the request look like below; http://www.test.com?txid=1&type=service&server=linux I have a list of "txid" (in *.txt) and need to run all "txid" acordingly. So that mean, every transaction i have to refer "txid"... (7 Replies)
Discussion started by: malaysoul
7 Replies
Login or Register to Ask a Question