An Error Occurred Sending Request. Status Code 400
Contents |
in 'General PHP and MySQL Discussions' started by Fuhrmann, Nov 24, 2011. Fuhrmann Well-Known Member Anyone know how to use it? http error 400 bad request I've used this: PHP: $amazon=newZend_Service_Amazon('MY_API_KEY','UK','MY_SCRET_API'); But 400 bad request fix when I do a $amazon->itemSearch I always get an error: Code: An error occurred sending request. Status code: 400 Fuhrmann, Nov 24, 2011 #1 Mikey Well-Known Member Check that
Http Status Code For Invalid Credentials
your API and Secret keys are correct. in HTTP status codes 400 means bad request, maybe it's just the amazon servers? I couldn't find anything you're doing wrong here: http://framework.zend.com/manual/en/zend.service.amazon.html Mikey, Nov 24, 2011 #2 Fuhrmann Well-Known Member The keys are fine. I really do not know what is happening. Thanks Mikey! Fuhrmann, Nov 24, 2011 #3 James Well-Known http status code for failed update Member Have you checked that all the dependencies of Zend_Service_Amazon are there? Someone had this problem with Zend_Service_Twitter. James, Nov 24, 2011 #4 Fuhrmann likes this. Fuhrmann Well-Known Member James said: ↑ Have you checked that all the dependencies of Zend_Service_Amazon are there? Someone had this problem with Zend_Service_Twitter.Click to expand... Yes... I search a lot and there is a lot of people with the same problem. Then, I found a bug report in here: http://zendframework.com/issues/browse/ZF-11904 That is...Amazon has changed the API and now requires a new parameter Associate Tag, that's why do not work, because in Zend Framework it is not updated yet. Fuhrmann, Nov 24, 2011 #5 Fuhrmann Well-Known Member Solved. I've added the new required parameter into the core of the Zend_Service_Amazon. And my computer date/time was wrong. Fuhrmann, Nov 25, 2011 #6 (You must log in or sign up to reply here.) Show Ignored Content Share This Page Tweet Log in with Facebook Log in with Twitter Log in with Google Your name or email address: Do you already have an account? No, create
here for a quick overview of the site Help Center Detailed answers to any questions you might 400 bad request chrome have Meta Discuss the workings and policies of this site About
Http Status Code For Login Failure
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads
400 Bad Request Request Header Or Cookie Too Large
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million https://xenforo.com/community/threads/zend_service_amazon.23763/ programmers, just like you, helping each other. Join them; it only takes a minute: Sign up REST HTTP status codes for failed validation or invalid duplicate up vote 455 down vote favorite 128 I'm building an application with a REST-based API and have come to the point where i'm specifying status codes for each requests. http://stackoverflow.com/questions/3290182/rest-http-status-codes-for-failed-validation-or-invalid-duplicate What status code should i send for requests failing validation or where a request is trying to add a duplicate in my database? I've looked through http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html but none of them seems right. Is there a common practice when sending status codes? http rest http-status-codes share|improve this question edited Sep 3 '14 at 15:02 Raedwald 17.4k1264104 asked Jul 20 '10 at 13:03 alexn 33.5k878119 3 See: stackoverflow.com/questions/1959947/… –deamon Jul 20 '10 at 13:39 6 Open httpstatus.es, Right Click >> Pin Tab :P –Salman Abbas May 24 '12 at 5:00 add a comment| 7 Answers 7 active oldest votes up vote 410 down vote accepted For input validation failure: 400 Bad Request + your optional description. This is suggested in the book "RESTful Web Services". For double submit: 409 Conflict Update June 2014 The relevant specification used to be RFC2616, which gave the use of 400 (Bad Request) rather narrowly as The request could not be understood by the server due to ma
For Invalid Data: 400 vs. 422 By Ben Nadel on October 17, 2012 Tags: ColdFusion Let's say that someone makes a request to your server with data that is in the correct format, but http://www.bennadel.com/blog/2434-http-status-codes-for-invalid-data-400-vs-422.htm is simply not "good" data. So for example, imagine that someone posted a String https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html value to an API endpoint that expected a String value; but, the value of the string contained data that was blacklisted (ex. preventing people from using "password" as their password). What HTTP status code would you return?Until now, I would have returned a "400 Bad Request", which, according to the w3.org, means:The request could not be status code understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.This description doesn't quite fit the circumstance; but, if you go by the list of core HTTP status codes defined in the HTTP/1.1 protocol, it's probably your best bet.Recently, however, Jamie Krug pointed out [to me] that popular APIs are starting to use HTTP extensions to get more granular with their error reporting. Specifically, many 400 bad request APIs, like Twitter and Recurly, are using the status code "422 Unprocessable Entity" as defined in the HTTP extension for WebDAV. HTTP status code 422 states:The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415 (Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.Going back to our password example from above, this 422 status code feels much more appropriate. The server understands what you're trying to do; and it understands the data that you're submitting; it simply won't let that data be processed.HTTP status code 422 feels like a much more appropriate response for situations where the data is understood, but is still not valid. I think I'll start using this going forward. Thanks Jamie! Tweet This Deep thoughts by @BenNadel - HTTP Status Codes For Invalid Data: 400 vs. 422 Thanks my man — you rock the party that rocks the body! Enjoyed This? You Might Also Enjoy Reading: Handling Forbidden RESTful Requests:
response. 10.1 Informational 1xx This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions. A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent. Proxies MUST forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. (For example, if a proxy adds a "Expect: 100-continue" field when it forwards a request, then it need not forward the corresponding 100 (Continue) response(s).) 10.1.1 100 Continue The client SHOULD continue with its request. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. The client SHOULD continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The server MUST send a final response after the request has been completed. See section 8.2.3 for detailed discussion of the use and handling of this status code. 10.1.2 101 Switching Protocols The server understands and is willing to comply with the client's request, via the Upgrade message header field (section 14.42), for a change in the application protocol being used on this connection. The server will switch protocols to those defined by the response's Upgrade header field immediately after the empty line which terminates the 101 response. The protocol SHOULD be switched only w