Re: Help using Network.Curl

I tried to translate that using the Network.Curl docs and ended up with the
following code, but it's not sending the post data correctly (an ebay
api error re an "unsupported verb", which I am told means a malformed
request). Any ideas? The code from a perl tutorial (which works for
me, making me think that my problem is just about the right way to
post xml to a web service) follows the haskell version, which is meant
to be a straight translation of that.
Thanks,
Jim
----------------------
[..skipped definitions of tokens etc..]
opts = [CurlEncoding "text/xml"
, CurlHttpHeaders ["X-EBAY-API-COMPATIBILITY-LEVEL="++compatLevel
, "X-EBAY-API-DEV-NAME="++devName
, "X-EBAY-API-APP-NAME="++appName
, "X-EBAY-API-CERT-NAME="++certName
, "X-EBAY-API-CALL-NAME=GeteBayOfficialTime"
, "X-EBAY-API-SITEID=0"]]
body = "<?xml version='1.0' encoding='utf-8'?>"
++ "
POST /ws/api.dll HTTP/1.1 Host: api.sandbox.ebay.com Accept: */* Accept-Encoding: text/xml Content-Length: 1254 Expect: 100-continue Content-Type: multipart/form-data; boundary=----------------------------7c836e9408cd
< HTTP/1.1 100 Continue < HTTP/1.1 200 OK < Date: Sat, 19 Jul 2008 20:04:12 GMT < Server: Microsoft-IIS/5.0 < X-EBAY-API-POOL-NAME: ___cDRidW90YmtiZWx9b2l3aQ== < X-EBAY-API-SERVER-NAME: ___dXUucnVlYnVvNzM3KTYzKzc3LTI0KTQxPD8zPTc= < Content-Type: text/xml < Content-Length: 330 < X-Cache: MISS from sjcsbagpigw02.sjc.ebay.com, MISS from sjcsbagpigw02.sjc.ebay.com < Connection: close < * Closing connection #0 <?xml version="1.0" encoding="UTF-8" ?><eBay><EBayTime>2008-07-19 20:04:55</EBayTime><Errors><Error><Code>2</Code><ErrorClass>RequestError</ErrorClass><SeverityCode>1</SeverityCode><Severity>SeriousError</Severity><Line>0</Line><Column>0</Column><ShortMessage><![CDATA[ Unsupported verb. ]]></ShortMessage></Error></Errors></eBay>

2008/7/19 Jim Burton
opts = [CurlEncoding "text/xml" , CurlHttpHeaders ["X-EBAY-API-COMPATIBILITY-LEVEL="++compatLevel , "X-EBAY-API-DEV-NAME="++devName , "X-EBAY-API-APP-NAME="++appName , "X-EBAY-API-CERT-NAME="++certName , "X-EBAY-API-CALL-NAME=GeteBayOfficialTime" , "X-EBAY-API-SITEID=0"]]
Isn't it ":" rather than "=" ? Just saying... (Don't know enough to be sure I'm thinking about the right thing) -- Jedaï

At Mon, 21 Jul 2008 13:21:06 +0100, =?ISO-8859-1?Q?Chadda=EF_Fouch=E9?= wrote:
2008/7/19 Jim Burton
: opts = [CurlEncoding "text/xml" , CurlHttpHeaders ["X-EBAY-API-COMPATIBILITY-LEVEL="++compatLevel , "X-EBAY-API-DEV-NAME="++devName , "X-EBAY-API-APP-NAME="++appName , "X-EBAY-API-CERT-NAME="++certName , "X-EBAY-API-CALL-NAME=GeteBayOfficialTime" , "X-EBAY-API-SITEID=0"]]
Isn't it ":" rather than "=" ? Just saying... (Don't know enough to be sure I'm thinking about the right thing)
Is is indeed, thanks very much. I also had to change to using `perform' rather than curlPost before it would work. Cheers, Jim
-- Jedaï
participants (2)
-
Chaddaï Fouché
-
Jim Burton