on 06-01-2011 9:02 PM
Hi,
I'm trying to upload a file to an activity;
I use:
URL:
Headers:
{content-type=multipart/form-data; boundary=myboundry, accept=application/xml, content-length=2720}
Message:
--myboundry
Content-Disposition: form-data; name="item"; filename="item.xml"
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?><item name="My Item Name"> <description>My File uploaded</description> <file_item/></item>
--myboundry
Content-Disposition: form-data; name="file"; filename="file.jpg"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
blah-blah binary content
--myboundry--
Method: POST
As result I constantly get ResponseCode 500 from the server.
To me it looks quite similar to the example from: https://streamwork.com/api/Trouble_shooting.html
Please, any idea what am I doing wrong ?
Thank you !
Thank you, Simon for the kind answer;
And just for the records, the reason for the issue is that the POST-ed content should directly start with the string:
--boundary
I started the content with an empty line, and this produced the 500 Internal Server error answer.
The page under:
https://streamwork.com/api/Trouble_shooting.html
is slightly unclear with respect of this aspect.
The content under:
http://wiki.sdn.sap.com/wiki/display/SWAPI/GuidedCodeExamplefortheIntegrationAPI
was btw also helpful.
Cheers !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think your MIME request looks fine. Check out the some documentation on multipart MIME, e.g. [this|http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html] one. Also, we do provide an [example|http://wiki.sdn.sap.com/wiki/display/SWAPI/GuidedCodeExamplefortheIntegrationAPI] for uploading data using the Integration API, you might read that one as well. Let us know if you were able to solve your problem.
Cheers
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.