View Single Post
08-09-16, 09:16 AM   #21
Dolby
PPAP
 
Dolby's Avatar
WoWInterface Admin
Join Date: Feb 2004
Posts: 2,341
Originally Posted by Phanx View Post
Using an API token instead of a cookie to upload a file, is it intended that there's no response body, and the only status codes returned are 200 (on a successful upload) or 00000 (for any error, which isn't even a valid HTTP status)?

It would be nice to get standard error codes like 404 (for missing/bad addon ID) or 403 (for missing/bad API token) and a message specifying the actual problem in other cases (missing/bad file, etc). For miscellaneous errors the CurseForge API gives a 422 (Unprocessable Entity) but there are plenty of 4xx statuses to choose from.

Also, to be pedantic, 201 (Created) or 202 (Accepted) would be more appropriate than 200 (OK).
We never had a body response when POSTing to the API unless there was an error, cookie or token. I'll add one.

When were you getting a 00000? You should get 40x's for missing token and other various errors? Not even sure how a 00000 could happen unless maybe our WAF is detecting something and doing something goofy, even then I've never seen it use those response codes?

Edit: you should now get a 202 and a response body when you successfully POST to the update endpoint.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2016-08-09 at 10.24.03 AM.png
Views:	615
Size:	52.1 KB
ID:	8777  

Last edited by Dolby : 08-09-16 at 09:36 AM.
  Reply With Quote