curl-users
XML Posting Question using Command Line cURL
Date: Tue, 15 Jul 2003 08:32:35 -0500
Hello,
I had a quick question for someone, if they could me out.
Trying to run this command line using cURL:
curl -v -o testit.bat -F @<filename>;type=text/xml --trace-ascii trace.txt
<website>
It appears everything runs OK, but when I verify the file reaches
the website it's not there. I see a 405 Method Not Allowed error when
viewing the trace results. Here is the trace.txt data I see:
== Info: About to connect() to <website>
== Info: Connected to <website>
=> Send header, 347 bytes (0x15b)
0000: POST /postxml HTTP/1.1
0018: User-Agent: curl/7.10.5 (win32) libcurl/7.10.5 OpenSSL/0.9.7a zl
0058: ib/1.1.4
0062: Host: <website>
0084: Pragma: no-cache
0096: Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
00d8: Content-Length: 163
00ed: Expect: 100-continue
0103: Content-Type: multipart/form-data; boundary=--------------------
0143: --------3b80c0c3715f
0159:
<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 100 Continue
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/5.1
<= Recv header, 37 bytes (0x25)
0000: Date: Tue, 15 Jul 2003 13:19:33 GMT
=> Send data, 163 bytes (0xa3)
0000: ------------------------------3b80c0c3715f
002c: Content-Disposition: form-data; name="@CS1_071503.xml;type"
0069:
006b: text/xml
0075: ------------------------------3b80c0c3715f--
<= Recv header, 33 bytes (0x21)
0000: HTTP/1.1 405 Method not allowed
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/5.1
<= Recv header, 37 bytes (0x25)
0000: Date: Tue, 15 Jul 2003 13:19:33 GMT
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 47 bytes (0x2f)
0000: Allow: OPTIONS, TRACE, GET, HEAD, PUT, DELETE
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 3923
<= Recv header, 25 bytes (0x19)
0000: Content-Type: text/html
<= Recv data, 3923 bytes (0xf53)
0000: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
0039: <html dir=ltr>
0049:
004b: <head>
0053: <style>
005c: a:link...{font:8pt/11pt verdana; color:FF0000}
008c: a:visited..{font:8pt/11pt verdana; color:#4e4e4e}
00bf: </style>
00c9:
00cb: <META NAME="ROBOTS" CONTENT="NOINDEX">
00f3:
00f5: <title>The page cannot be displayed</title>
0122:
0124: <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Wind
0164: ows-1252">
0170: </head>
0179:
017b: <script>
0186: function Homepage(){
019c: <!--
01a2: // in real bits, urls get returned to our script like this:
01df: // res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
0221:
0223: .//For testing use DocURL = "res://shdocvw.dll/http_404.htm#http
0263: s://www.microsoft.com/bar.htm"
0283: .DocURL=document.URL;
029a: .
029d: .//this is where the http or https will be, as found by searchin
02dd: g for :// but skipping the res://
0300: .protocolIndex=DocURL.indexOf("://",4);
0329: .
032c: .//this finds the ending slash for the domain server
0363: .serverIndex=DocURL.indexOf("/",protocolIndex + 3);
0398:
039a: .//for the href, we need a valid URL to the domain. We search fo
03da: r the # symbol to find the begining
0400: .//of the true URL, and add 1 to skip it - this is the BeginURL
0440: value. We use serverIndex as the end marker.
046e: .//urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
04ad: .BeginURL=DocURL.indexOf("#",1) + 1;
04d3: .urlresult=DocURL.substring(BeginURL,serverIndex);
0507: ..
050b: .//for display, we need to skip after http://, and go to the nex
054b: t slash
0554: .displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);
0596: .InsertElementAnchor(urlresult, displayresult);
05c7: }
05ca:
05cc: function HtmlEncode(text)
05e7: {
05ea: return text.replace(/&/g, '&').replace(/'/g, '"').re
062a: place(/</g, '<').replace(/>/g, '>');
0656: }
0659:
065b: function TagAttrib(name, value)
067c: {
067f: return ' '+name+'="'+HtmlEncode(value)+'"';
06b0: }
06b3:
06b5: function PrintTag(tagName, needCloseTag, attrib, inner){
06ef: document.write( '<' + tagName + attrib + '>' + HtmlEncode(in
072f: ner) );
0738: if (needCloseTag) document.write( '</' + tagName +'>' );
0776: }
0779:
077b: function URI(href)
078f: {
0792: IEVer = window.navigator.appVersion;
07bc: IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 );
07f7:
07f9: return (IEVer.charAt(1)=='.' && IEVer >= '5.5') ?
0830: encodeURI(href) :
084b: escape(href).replace(/%3A/g, ':').replace(/%3B/g, ';');
088c: }
088f:
0891: function InsertElementAnchor(href, text)
08bb: {
08be: PrintTag('A', true, TagAttrib('HREF', URI(href)), text);
08fc: }
08ff:
0901: //-->
0908: </script>
0913:
0915: <body bgcolor="FFFFFF">
092e:
0930: <table width="410" cellpadding="3" cellspacing="5">
0965:
0967: <tr>
0972: <td align="left" valign="middle" width="360">
09a5: .<h1 style="COLOR:000000; FONT: 13pt/15pt verdana"><!--Problem--
09e5: >The page cannot be displayed</h1>
0a09: </td>
0a14: </tr>
0a1d:
0a21: <tr>
0a29: <td width="400" colspan="2">
0a4b: .<font style="COLOR:000000; FONT: 8pt/11pt verdana">The page you
0a8b: are looking for cannot be displayed because the page address is
0acb: incorrect.</font> </td>
0ae5: </tr>
0aee:
0af2: <tr>
0afa: <td width="400" colspan="2">
0b1c: .<font style="COLOR:000000; FONT: 8pt/11pt verdana">
0b52:
0b54: .<hr color="#C0C0C0" noshade>
0b73: .
0b76: <p>Please try the following:</p>
0b9c:
0b9e: .<ul>
0ba5: <li>If you typed the page address in the Address bar, chec
0be5: k that it is entered correctly.<br>
0c0a: </li>
0c17: .
0c1c: <li>Open the
0c32: .
0c38: . <script>
0c46: . <!--
0c50: . if (!((window.navigator.userAgent.indexOf("MSIE") > 0) && (w
0c90: indow.navigator.appVersion.charAt(0) == "2")))
0cc0: . {
0cc7: . . Homepage();
0cda: . }
0ce1: . //-->
0cec: . </script>
0cfb:
0cfd: . home page and then look for links to the information you wan
0d3d: t.</li>
0d46: </ul>
0d51:
0d57: <h2 style="COLOR:000000; FONT: 8pt/11pt verdana">HTTP 405 -
0d97: Resource not
0da5: allowed<br>
0db6: Internet Information Services</h2>
0dde: .
0de1: .<hr color="#C0C0C0" noshade>
0e00: .
0e03: .<p>Technical Information (for support personnel)</p>
0e3a: .
0e3d: <ul>
0e43: <li>More information:<br>
0e5e: <a href="http://www.microsoft.com/ContentRedirect.asp?prd=iis&sb
0e9e: p=&pver=5.0&pid=&ID=405&cat=web&os=&over=&hrd=&Opt1=&Opt2=&Opt3=
0ede: " target="_blank">Microsoft Support</a>
0f07: </li>
0f0e: </ul>
0f16:
0f18: </font></td>
0f2a: </tr>
0f33:
0f37: </table>
0f41: </body>
0f4a: </html>
== Info: Closing connection #0
Any help would be greatly appreciated.
thanks..
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
Received on 2003-07-15