0
votes

Actually sending json string(Post) to server got 400 bad request exception,

below Url i got this exception

_http://---.---.--.---:---/SignUp/SignupUser/{JSON STRING}/{PASSWORD}

so the JSON string and password is given below

_http://---.---.--.---:----/SignUp/SignupUser/{"SessionId":"99c77c9b-043e-4611-a011-e774c614e887","PassWord":"234434343434","UserName":"john_mcclane","FirstName":"John","LastName":"mcclane","NickName":"Bruno","Gender":0,"DateTime":"2013-12-19T10:39:37","AddressLine1":"Paradigm Talent Agency NY","AddressLine2":"360 Park Ave South, 16th Floor","City":"New York","State":"New York","Country":"USA","Zip":"N.Y. 10010","EmailId":"[email protected]","MobileNumber":"7189615565","AlternativeNumber":"9179615565","ProofType":"License","ProofNumber":"I1234562","IsDogAllowed":true,"IsDrinkersAllowed":true,"IsSmokersAllowed":true}/{234434343434}

please tell what i did wrong in it.

Note : I am trying this in the advance rest client google chrome.

1
Try url-encoding it, if it has to be a GET request. - towr
Have you looked at your server logs? Perhaps it gives a reason why it's a bad request. - towr
@VikramBose: Even if you succeed to send Json data through GET, it's outright wrong to send user name and password like that. See this related SO post. Which client platform are you using? HTML/Javascript/C++/C#/Java? - Hariprasad
@Hariprasad : I am using Advanced rest client tool to access this, Andriod and IOS developer will access this, Actually here the password appending is possible in POST method for outside from different clients? - Vikram Bose
You can find an image here which shows how to send the POST request using Advacned http client. But, a lot of questions still remain. Does your server code support a POST request like this? Or does it require the client to send request through GET?If latter is the case, I would recommend to change it and use POST method instead because that will solve a lot of security loop holes. - Hariprasad

1 Answers

1
votes

You have created the POST request with two arguments (JSON object and password). The typical REST service post request can have only one argument. So, try with one argument by sending the password with the JSON object itself.