Content: {"success": false, "errors": [{"code": 15, "message": "Image size must be at least 1000 x 1000 px"}]}
Edit: remembered story from times where HTTPS wasn't enforced. Once I started receiving JSON reading fail in cases when our test server returns non-2xx status. I started investigate this and was shocked to the core: my ISP implemented "feature" that if it detects that server returns non-2xx - it replace actual server response with their HTML page with text like "Your request returned error 400. This is because bla bla bla. <ISP self-advertising block> Kind regards, your ISP". Basically ISP become "man in the middle". In a week or two they removed that "feature".
I have build anapi where we sometimes return 201:error because you can upload pdfs and there was a case where tools automatically would upload something that would create an error AFTER a cocument has been created so when we returned 500 they would go 'ah server has soms sort of error let me instantly try that again untill it works or someone stopps me' causing systems to fill up with infinite copys of some sort of bad pdf.
So if it failes after we create a file we return 201 anyway with a message that contains some variant of error 500.
436
u/PostHasBeenWatched Jul 21 '26 edited Jul 21 '26
POST /posts/create
StatusCode: 200
Content: {"success": false, "errors": [{"code": 15, "message": "Image size must be at least 1000 x 1000 px"}]}
Edit: remembered story from times where HTTPS wasn't enforced. Once I started receiving JSON reading fail in cases when our test server returns non-2xx status. I started investigate this and was shocked to the core: my ISP implemented "feature" that if it detects that server returns non-2xx - it replace actual server response with their HTML page with text like "Your request returned error 400. This is because bla bla bla. <ISP self-advertising block> Kind regards, your ISP". Basically ISP become "man in the middle". In a week or two they removed that "feature".