CopyPastor

Detecting plagiarism made easy.

Score: 0.8066194028041924; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2018-03-15
by Sho\_arg

Original Post

Original - Posted on 2013-10-30
by Vidya



            
Present in both answers; Present only in the new answer; Present only in the old answer;

A 400 means that the request was malformed. In other words, the data stream sent by the client to the server didn't follow the rules.
So, something is wrong by your side. In official doc it is mentioned that you should request POST method but you have have request GET method.
URL url = new URL("https://api.gdax.com/accounts"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("POST");
Hope, this may help!
A 400 means that the request was malformed. In other words, the data stream sent by the client to the server didn't follow the rules.
In the case of a REST API with a JSON payload, 400's are typically, and correctly I would say, used to indicate that the JSON is invalid in some way according to the API specification for the service.
By that logic, both the scenarios you provided should be 400's.
Imagine instead this were XML rather than JSON. In both cases, the XML would never pass schema validation--either because of an undefined element or an improper element value. That would be a bad request. Same deal here.

        
Present in both answers; Present only in the new answer; Present only in the old answer;