[英]Using java to connect to a site and POST, HTTP Status Code 200
I am using java to connect to a website which has a form of type "multipart/form-data". 我使用java连接到一个网站,其形式为“multipart / form-data”。 It asks a user, pass, and file to upload.
它要求用户,传递和文件上传。
When i run my java project, the response i get is "200". 当我运行我的java项目时,我得到的响应是“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."
根据w3.org,2xx类HTTP响应中的任何内容都表明“客户端的请求已成功接收,理解和接受”。
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?
换句话说,代码“200”是我发送的文件在服务器上的保证,还是只是表明我的POST请求被理解了?
Thank you! 谢谢!
The HTTP status code 200 states that HTTP状态代码200表明了这一点
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.
但是,这并不能告诉您Web应用程序的功能。 It's up to the web application itself to tell you, possibly as part of the HTTP response.
Web应用程序本身可以告诉您,可能是HTTP响应的一部分。
You should check the web application API or specification and interpret the HTTP response accordingly. 您应该检查Web应用程序API或规范并相应地解释HTTP响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.