http-response-codes

REST API response in partial success

时光毁灭记忆、已成空白 提交于 2019-12-01 15:14:11
问题 I have an API which does some bulk processing task. Let's say it does naming of some resource. I passed 7 request in bulk, out of which 5 updated successfully and 2 failed. My question is how to handle the response. With HTTP I can't return both success and error at same time. There is a HTTP code of partial success but I need to return individual response of all resource at once. Is there anyway we can do it? 回答1: You may use 207 MULTI-STATUS for http status A Multi-Status response conveys

How long does Chrome remember a 301 redirect?

ε祈祈猫儿з 提交于 2019-11-30 10:54:59
问题 I have a new author site that I want to make available from a domain that I had previously used Apache rewriting to bounce traffic to my Amazon site, [R=301,L], which I want to serve up as my own site. I also have a new domain for the interim at least. Is there (are there) particular durations of times when Chrome in particular will store 301 cached redirects? Some other questions, How long do browsers cache HTTP 301s? and How is 301 redirect implemented by different browsers? , ask, and the

How long does Chrome remember a 301 redirect?

会有一股神秘感。 提交于 2019-11-30 00:19:51
I have a new author site that I want to make available from a domain that I had previously used Apache rewriting to bounce traffic to my Amazon site, [R=301,L], which I want to serve up as my own site. I also have a new domain for the interim at least. Is there (are there) particular durations of times when Chrome in particular will store 301 cached redirects? Some other questions, How long do browsers cache HTTP 301s? and How is 301 redirect implemented by different browsers? , ask, and the answer is given that some browsers do not cache, some cache for the session, and Chrome and IE10 cache

NSUrlConnectionDelegate - Getting http status codes

◇◆丶佛笑我妖孽 提交于 2019-11-28 21:06:23
in iOS, how can I receive the http status code (404,500 200 etc) for a response from a web server. I am assuming it's in the NSUrlConnectionDelegate. Objective-C or Monotouch .NET answer ok. Yes, you can get status code in delegate method -didRecieveResponse: - (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; int code = [httpResponse statusCode]; } Manuel NSHTTPURLResponse* urlResponse = nil; NSError *error = nil; responseData = [NSURLConnection sendSynchronousRequest:request

RESTful Login Failure: Return 401 or Custom Response

别说谁变了你拦得住时间么 提交于 2019-11-28 17:21:09
This is a conceptual question. I have a client (mobile) application which needs to support a login action against a RESTful web service. Because the web service is RESTful, this amounts to the client accepting a username/password from the user, verifying that username/password with the service, and then just remembering to send that username/password with all subsequent requests. All other responses in this web service are provided in a JSON format. The question is, when I query the web service simply to find out whether a given username/password are valid, should the web service always

NSUrlConnectionDelegate - Getting http status codes

喜欢而已 提交于 2019-11-27 20:51:28
问题 in iOS, how can I receive the http status code (404,500 200 etc) for a response from a web server. I am assuming it's in the NSUrlConnectionDelegate. Objective-C or Monotouch .NET answer ok. 回答1: Yes, you can get status code in delegate method -didRecieveResponse: - (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; int code = [httpResponse statusCode]; } 回答2: NSHTTPURLResponse*

What does the HTTP 206 Partial Content status message mean and how do I fully load resources?

一个人想着一个人 提交于 2019-11-27 12:21:58
I have some image tags on a site like this. <img src="img.png"/> When I try to load them they are only half loading. When I checked the request in the network console I see that the response is: 206 Partial Content I googled it and it says that if there is a range set in header, it will be like this. But where are these headers actually set? And how do I avoid this and load the full images? csaron92 From user166390’s answer to the question Why does Firebug show a "206 Partial Content" response on a video loading request? This Partial Content code (206) may be sent from the server when the

RESTful Login Failure: Return 401 or Custom Response

痴心易碎 提交于 2019-11-27 10:24:30
问题 This is a conceptual question. I have a client (mobile) application which needs to support a login action against a RESTful web service. Because the web service is RESTful, this amounts to the client accepting a username/password from the user, verifying that username/password with the service, and then just remembering to send that username/password with all subsequent requests. All other responses in this web service are provided in a JSON format. The question is, when I query the web

What does the HTTP 206 Partial Content status message mean and how do I fully load resources?

白昼怎懂夜的黑 提交于 2019-11-26 15:58:47
问题 I have some image tags on a site like this. <img src="img.png"/> When I try to load them they are only half loading. When I checked the request in the network console I see that the response is: 206 Partial Content I googled it and it says that if there is a range set in header, it will be like this. But where are these headers actually set? And how do I avoid this and load the full images? 回答1: From user166390’s answer to the question Why does Firebug show a "206 Partial Content" response on

What is “406-Not Acceptable Response” in HTTP?

别说谁变了你拦得住时间么 提交于 2019-11-25 23:18:32
问题 In my Ruby on Rails application I tried to upload an image through the POSTMAN REST client in Base64 format. When I POST the image I am getting a 406 Not Acceptable Response . When I checked my database, the image was there and was successfully saved. What is the reason for this error, is there anything I need to specify in my header? My request: URL --- http://localhost:3000/exercises.json Header: Content-Type - application/json Raw data: { \"exercise\": { \"subbodypart_ids\": [ \"1\", \"2\"