Question

I am using java to connect to a website which has a form of type "multipart/form-data". It asks a user, pass, and file to upload.

When i run my java project, the response i get is "200". According to w3.org, anything in the 2xx class of HTTP responses indicates that "the client's request was successfully received, understood, and accepted."

My question is, if this is the response code i get, can i assume that the file was DEFINITELY uploaded to the site, and that there was no error? To put it in other wording, is the code "200" a guarantee that the file i sent is on the server, or is it just indicating that my POST request was understood?

Thank you!

Was it helpful?

Solution

The HTTP status code 200 states that

The request has succeeded.

The server is therefore telling you that the request you made was successful. However, this doesn't tell you anything about what the web application did. It's up to the web application itself to tell you, possibly as part of the HTTP response.

You should check the web application API or specification and interpret the HTTP response accordingly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top