Take the 2-minute tour ×

After uploading a file with a name conflict with existing one, the server still responds with HTTP status code 201 Created. I had to parse the response body to know exactly whether it is really created or not. It sounds to me that I should be able to know the result of the operation just by the status code. So I am wondering if this is an intended behavior.

The following is the response I get

     "message":"Item with the same name already exists",
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

We are in the process of changing this from a 200 to a 202. Later this week (or possibly tonight) we'll roll out a change to make upload statuses be 202's, to show that the upload request has been accepted. I'll post a bit more on our blog to explain more details.

The basic logic is that uploads can be sent in bulk, and the API call has to return you an array of upload statuses (stati?). If you only upload one file, you'll get an array of 1, and you'll have to dig into the array to see if you were successful or not. If you upload a group of files, then you'll be digging into the array to find out the status of each file.

You might ask: Why not collapse the status when there is only one file? Our thought there is that you'd have to implement 2 different code paths to deal with single vs bulk-upload, and it would be easier to just write the code once to handle uploads either way.

Hope that helps. Let us know if you see unexpected behavior after we flip the error code over from the 200 to the 202.

share|improve this answer
That's a clear explanation. Thanks for clarifying. –  Azu Aug 29 '12 at 2:31
add comment

Your Answer


