1

I am trying to send a HTTP Server request (JSON Encoded String) to server, but don't understand how to make the server request.

This is the format which gives me JSON response.

   {
"api_id": "Ddbl77c22oCVrXQs2WiZ",
"api_secret": "qjN9eEB9VVVKZm0PzKfqjN9eEB8",
"api_request": "login_user",
"data": {
    "user_name": "sampanchal2611@gmail.com",
    "user_type": "general",
    "password": "123456789",
    "device_id": "webdevdeid",
    "device_type": "test"
}

}

ballade4op52
  • 2,142
  • 5
  • 27
  • 42
  • Dude, you just posted wayyy to much data that could compromise the security of your application. It appears your api uses oAuth. Dude, your api secret is called that for a reason. – Curious Programmer Oct 17 '15 at 20:34

2 Answers2

2

Create a data object (model) that will represent the data you want to send in your JSON.

Then use a library like Retrofit to send your data to the server.

SuperFrog
  • 7,631
  • 9
  • 51
  • 81
0

You need to use a http post to the url that the website accepts api requests from. Read the documentation of your api for more information.

Curious Programmer
  • 433
  • 1
  • 5
  • 14