• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Volley - no response from the URL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to get any response from the URL I am hitting using the Volley library, please can you help me out ?

I am getting this on my emulator : "com.android.volley.NoConnectionError:java.io.IOexception:content length promised 45 bytes, but received 0 ."

I have pasted the code below:

RequestQueue queue = Volley.newRequestQueue(this);

String url = "http://ipchicken.com"

JsonObjectRequest jsObjRequest = new JsonObjectRequest(
Request.Method.POST, url, null,
new Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
// TODO Auto-generated method stub
sampletext.setText("Response => " + response.toString());


}
}, new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError error) {
// TODO Auto-generated method stub
sampletext.setText( error.toString());

}
});

queue.add(jsObjRequest);
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are not getting any Response then check your code. In this example you can see the full working of Volley and definitely you can solve your problem that you are getting Volley Tutorial
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic