I'm trying to upload a file to box.net using rest api. But I'm getting 404 error each time. Here request headers (from fiddler). Where I've made mistake?
POST https://api.box.com/2.0/files/content HTTP/1.1
Authorization: BoxAuth api_key={key}&auth_token={tokem}
Content-Type: multipart/form-data; boundary="13afaf22-f210-464b-bcc3-3cd3e4ed1617"
Host: api.box.com
Content-Length: 166
Expect: 100-continue
--13afaf22-f210-464b-bcc3-3cd3e4ed1617
Content-Disposition: form-data; filename=test.zip; folder_id=0
{empty line - I don't know why it here}
{bytes starting here}
--13afaf22-f210-464b-bcc3-3cd3e4ed1617--
Note I'm using c# with its HttpClient class and MultiPartFormDataContent as a content source.
SOLVED:
Problem was solved. Request headers and body should look like this:
POST https://api.box.com/2.0/files/content HTTP/1.1
Authorization: BoxAuth api_key={key}&auth_token={token}
Content-Type: multipart/form-data; boundary="d174f29b-6def-47db-8519-3da38b21b398"
Host: api.box.com
Content-Length: 314
Expect: 100-continue
--d174f29b-6def-47db-8519-3da38b21b398
Content-Disposition: form-data; filename="hello.txt"; name="filename"
Content-Type: application/octet-stream
{Bytes}
--d174f29b-6def-47db-8519-3da38b21b398
Content-Disposition: form-data; name="folder_id"
0
--d174f29b-6def-47db-8519-3da38b21b398--
Thanks