سلام
با کتابخانه VOLLEY دو مقدار رو به سرور ارسال میکنم . حالا اگر این 2 مقدار انگلیسی باشن انجام میشه ولی فارسی ارور میده
چه تغییراتی تو کد بدم که درست بشه ؟؟؟
RequestQueue MyRequestQueue = Volley.newRequestQueue(Send_Data.this);
String url ="http://xxxxxxxxxxxxxxx/sample.php";
StringRequest MyStringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
//This code is executed if the server responds, whether or not the response contains data.
//The String 'response' contains the server's response.
Log.i("VOLLEY", response);
}
}, new Response.ErrorListener() { //Create an error listener to handle errors appropriately.
@Override
public void onErrorResponse(VolleyError error) {
//This code is executed if there is an error.
//
Log.i("VOLLEY", error.toString());
}
}) {
protected Map<String, String> getParams() {
Map<String, String> MyData = new HashMap<String, String>();
MyData.put("NAME","xxxxx"); //Add the data you'd like to send to the server.
MyData.put("FNAME","test"); //Add the data you'd like to send to the server.
return MyData;
}
};
MyRequestQueue.add(MyStringRequest);