Skip to content

Most visited

Recently visited


Making a Standard Request

This lesson teaches you to

  1. Request JSON


Volley: Easy, Fast Networking for Android

This lesson describes how to use the common request types that Volley supports:

If your expected response is one of these types, you probably don't have to implement a custom request. This lesson describes how to use these standard request types. For information on how to implement your own custom request, see Implementing a Custom Request.

Request JSON

Volley provides the following classes for JSON requests:

Both classes are based on the common base class JsonRequest. You use them following the same basic pattern you use for other types of requests. For example, this snippet fetches a JSON feed and displays it as text in the UI:


val url = "http://my-json-feed"

val jsonObjectRequest = JsonObjectRequest(Request.Method.GET, url, null,
        Response.Listener { response ->
            textView.text = "Response: %s".format(response.toString())
        Response.ErrorListener { error ->
            // TODO: Handle error

// Access the RequestQueue through your singleton class.


String url = "http://my-json-feed";

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

    public void onResponse(JSONObject response) {
        mTextView.setText("Response: " + response.toString());
}, new Response.ErrorListener() {

    public void onErrorResponse(VolleyError error) {
        // TODO: Handle error


// Access the RequestQueue through your singleton class.
For an example of implementing a custom JSON request based on Gson, see the next lesson, Implementing a Custom Request.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)