Android volley request using curl command -


i want pass content web server on format

curl -h "content-type:application/json" -x post -d {"email":"someone@example.com","first_name":"fname","last_na‌​me":"lname","passwor‌​d":"pass123"}' 192.xxx.xxx.xxx:1111/register_user  

this how need pass values server. can 1 me. how possible using volley? in advance

yes can in way

 jsonobjectrequest jsonrequest = new jsonobjectrequest(request.method.post, "192.xxx.xxx.xxx:1111/register_user", new jsonobject("{"email":"someone@example.com","first_name":"fname","last_na‌​me":"lname","passwor‌​d":"pass123"}"),             new response.listener<jsonobject>() {                 @override                 public void onresponse(jsonobject jsonobject) {          //call successful                 }             },             new response.errorlistener() {                 @override                 public void onerrorresponse(volleyerror volleyerror) { //error occur                  }             }) {          @override         public map<string, string> getheaders() throws authfailureerror {             map<string, string> params = new hashmap<>();             params.put("content-type", "application/json");             params.put("accept", "application/json");             params.put("accept-encoding", "utf-8");             return params;         }     };     jsonrequest.setretrypolicy(new defaultretrypolicy(             my_socket_timeout_ms,             defaultretrypolicy.default_max_retries,             defaultretrypolicy.default_backoff_mult));     mrequestqueue.addtorequestqueue(jsonrequest); 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -