I am using the postman application to communicate using REST APIs between https server and client.
https client needs to send a binary file to the server. http get request is used for this over postman application. A snippet from postman when sending the http get request is as below:
–header ‘Content-Type: application/octet-stream’
The http client would begin uploading the binary file. However, there are times when the http server would like to abort the request before receiving the entire file. Is it possible for the http server to send a bad request (400) response while the client is uploading the file? The idea is instead of waiting for the entire file to be uploaded onto the server, the server cancels/aborts/sends a response with failure so the client would stop uploading the file. Can someone help me if this is possible?
The reason I ask is I observed that when the server sends 400 response while the client is uploading, postman on the client side mentions about a parse error, though the response is properly structured. Not sure where I am going wrong.