Adding custom header with volley request and response is “data”: “This field is required”
i am just started with volley request with custom request here is peace of code what i am using for sending a custom header. headers must be
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
When i am hitting this url with postman it is working fine.
row data in postman
and
Headers
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (dialog != null)
dialog.dismiss();
if (response != null) {
dialog.dismiss();
Log.e("res", response);
// eventHandler.onResponse("" + method, response);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (dialog != null)
dialog.dismiss();
eventHandler.onResponse("" + method, "");
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap headers = new HashMap();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return headers != null ? headers : super.getHeaders();
}
@Override
public byte getBody() {
String str = "{"firstname":"Test", "lastname":"User", "gender":"male", "country":"US", "zipcode":"H1A NFG", "email":"testuseef434532r@mail.com", "password":"123456", "referral_code":"", "requested_plan":""}";
return str.getBytes();
}
/* Tried with this
@Override
public byte getBody() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("firstname","Sandeep");
jsonObject.put("lastname","Parish");
jsonObject.put("gender","M");
jsonObject.put("country","US");
jsonObject.put("zipcode","H1A NFG");
jsonObject.put("email","usermail@localmail.com");
jsonObject.put("password","123456");
jsonObject.put("referral_code","123456");
jsonObject.put("requested_plan","123456");
} catch (JSONException e) {
e.printStackTrace();
}
return jsonObject.toString().getBytes();
}
//Tried with map
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
*/
@Override
public String getBodyContentType() {
return "application/json";
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
please help me to find out what's the issue with this code i am getting response with this code is.
E/res: {
"success": false,
"data": "This field is required"
}
if any issue at my side please let me know.
java android android-studio android-volley
|
show 15 more comments
i am just started with volley request with custom request here is peace of code what i am using for sending a custom header. headers must be
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
When i am hitting this url with postman it is working fine.
row data in postman
and
Headers
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (dialog != null)
dialog.dismiss();
if (response != null) {
dialog.dismiss();
Log.e("res", response);
// eventHandler.onResponse("" + method, response);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (dialog != null)
dialog.dismiss();
eventHandler.onResponse("" + method, "");
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap headers = new HashMap();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return headers != null ? headers : super.getHeaders();
}
@Override
public byte getBody() {
String str = "{"firstname":"Test", "lastname":"User", "gender":"male", "country":"US", "zipcode":"H1A NFG", "email":"testuseef434532r@mail.com", "password":"123456", "referral_code":"", "requested_plan":""}";
return str.getBytes();
}
/* Tried with this
@Override
public byte getBody() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("firstname","Sandeep");
jsonObject.put("lastname","Parish");
jsonObject.put("gender","M");
jsonObject.put("country","US");
jsonObject.put("zipcode","H1A NFG");
jsonObject.put("email","usermail@localmail.com");
jsonObject.put("password","123456");
jsonObject.put("referral_code","123456");
jsonObject.put("requested_plan","123456");
} catch (JSONException e) {
e.printStackTrace();
}
return jsonObject.toString().getBytes();
}
//Tried with map
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
*/
@Override
public String getBodyContentType() {
return "application/json";
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
please help me to find out what's the issue with this code i am getting response with this code is.
E/res: {
"success": false,
"data": "This field is required"
}
if any issue at my side please let me know.
java android android-studio android-volley
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16
|
show 15 more comments
i am just started with volley request with custom request here is peace of code what i am using for sending a custom header. headers must be
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
When i am hitting this url with postman it is working fine.
row data in postman
and
Headers
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (dialog != null)
dialog.dismiss();
if (response != null) {
dialog.dismiss();
Log.e("res", response);
// eventHandler.onResponse("" + method, response);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (dialog != null)
dialog.dismiss();
eventHandler.onResponse("" + method, "");
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap headers = new HashMap();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return headers != null ? headers : super.getHeaders();
}
@Override
public byte getBody() {
String str = "{"firstname":"Test", "lastname":"User", "gender":"male", "country":"US", "zipcode":"H1A NFG", "email":"testuseef434532r@mail.com", "password":"123456", "referral_code":"", "requested_plan":""}";
return str.getBytes();
}
/* Tried with this
@Override
public byte getBody() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("firstname","Sandeep");
jsonObject.put("lastname","Parish");
jsonObject.put("gender","M");
jsonObject.put("country","US");
jsonObject.put("zipcode","H1A NFG");
jsonObject.put("email","usermail@localmail.com");
jsonObject.put("password","123456");
jsonObject.put("referral_code","123456");
jsonObject.put("requested_plan","123456");
} catch (JSONException e) {
e.printStackTrace();
}
return jsonObject.toString().getBytes();
}
//Tried with map
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
*/
@Override
public String getBodyContentType() {
return "application/json";
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
please help me to find out what's the issue with this code i am getting response with this code is.
E/res: {
"success": false,
"data": "This field is required"
}
if any issue at my side please let me know.
java android android-studio android-volley
i am just started with volley request with custom request here is peace of code what i am using for sending a custom header. headers must be
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
When i am hitting this url with postman it is working fine.
row data in postman
and
Headers
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (dialog != null)
dialog.dismiss();
if (response != null) {
dialog.dismiss();
Log.e("res", response);
// eventHandler.onResponse("" + method, response);
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
if (dialog != null)
dialog.dismiss();
eventHandler.onResponse("" + method, "");
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap headers = new HashMap();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return headers != null ? headers : super.getHeaders();
}
@Override
public byte getBody() {
String str = "{"firstname":"Test", "lastname":"User", "gender":"male", "country":"US", "zipcode":"H1A NFG", "email":"testuseef434532r@mail.com", "password":"123456", "referral_code":"", "requested_plan":""}";
return str.getBytes();
}
/* Tried with this
@Override
public byte getBody() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("firstname","Sandeep");
jsonObject.put("lastname","Parish");
jsonObject.put("gender","M");
jsonObject.put("country","US");
jsonObject.put("zipcode","H1A NFG");
jsonObject.put("email","usermail@localmail.com");
jsonObject.put("password","123456");
jsonObject.put("referral_code","123456");
jsonObject.put("requested_plan","123456");
} catch (JSONException e) {
e.printStackTrace();
}
return jsonObject.toString().getBytes();
}
//Tried with map
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
*/
@Override
public String getBodyContentType() {
return "application/json";
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
please help me to find out what's the issue with this code i am getting response with this code is.
E/res: {
"success": false,
"data": "This field is required"
}
if any issue at my side please let me know.
java android android-studio android-volley
java android android-studio android-volley
edited Nov 23 '18 at 6:38
asked Nov 23 '18 at 6:03
Sandeep Parish
1,0801113
1,0801113
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16
|
show 15 more comments
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16
|
show 15 more comments
1 Answer
1
active
oldest
votes
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441359%2fadding-custom-header-with-volley-request-and-response-is-data-this-field-is%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
add a comment |
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
add a comment |
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
StringRequest stringRequest = new StringRequest(Request.Method.POST,
WebConstants.BASE_URL + method,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
@Override
protected Map<String, String> getParams() {
Map<String, String> map = new HashMap<>();
map.put("firstname", "sandeep");
map.put("lastname", "sada");
map.put("gender", "d");
map.put("country", "sdfasiio");
map.put("zipcode", "test");
map.put("email", "testmail@mail.com");
map.put("password", "0");
map.put("referral_code", "0");
map.put("requested_plan", "0");
Log.e("Map", map.toString());
return map;
}
};
stringRequest.setShouldCache(false);
stringRequest.setRetryPolicy(new DefaultRetryPolicy(
DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
RequestQueue requestQueue = Volley.newRequestQueue(context);
requestQueue.add(stringRequest);
answered Nov 24 '18 at 7:39
Jatin Sahgal
93
93
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
add a comment |
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
What you change in it
– Sandeep Parish
Nov 26 '18 at 4:51
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
by the way thanks fr answering issue is solved
– Sandeep Parish
Nov 26 '18 at 4:52
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441359%2fadding-custom-header-with-volley-request-and-response-is-data-this-field-is%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
how you use it with postman? Can you show the screenshot?
– Vladyslav Matviienko
Nov 23 '18 at 6:05
you should send body parameters as key value pair instead of json string
– Vivek Mishra
Nov 23 '18 at 6:06
@VladyslavMatviienko added that and Vivek let me check with your solution.
– Sandeep Parish
Nov 23 '18 at 6:11
show the body of the request. I want to check how you send the data
– Vladyslav Matviienko
Nov 23 '18 at 6:12
@VivekMishra Thanks but issue not resolved yet
– Sandeep Parish
Nov 23 '18 at 6:16