类 JsonObjectRequest

java.lang.Object
com.android.volley.Request<T>
com.android.volley.toolbox.JsonRequest<org.json.JSONObject>
com.android.volley.toolbox.JsonObjectRequest
所有已实现的接口:
Comparable<Request<org.json.JSONObject>>

public class JsonObjectRequest extends JsonRequest<org.json.JSONObject>
A request for retrieving a JSONObject response body at a given URL, allowing for an optional JSONObject to be passed in as part of the request body.
  • 构造器详细资料

    • JsonObjectRequest

      public JsonObjectRequest(int method, String url, org.json.JSONObject jsonRequest, Response.Listener<org.json.JSONObject> listener, Response.ErrorListener errorListener)
      Creates a new request.
      参数:
      method - the HTTP method to use
      url - URL to fetch the JSON from
      jsonRequest - A JSONObject to post with the request. Null is allowed and indicates no parameters will be posted along with request.
      listener - Listener to receive the JSON response
      errorListener - Error listener, or null to ignore errors.
    • JsonObjectRequest

      public JsonObjectRequest(String url, org.json.JSONObject jsonRequest, Response.Listener<org.json.JSONObject> listener, Response.ErrorListener errorListener)
      Constructor which defaults to GET if jsonRequest is null, POST otherwise.
      另请参阅:
  • 方法详细资料

    • parseNetworkResponse

      protected Response<org.json.JSONObject> parseNetworkResponse(NetworkResponse response)
      从类复制的说明: Request
      Subclasses must implement this to parse the raw network response and return an appropriate response type. This method will be called from a worker thread. The response will not be delivered if you return null.
      指定者:
      parseNetworkResponse 在类中 JsonRequest<org.json.JSONObject>
      参数:
      response - Response from the network
      返回:
      The parsed response, or null in the case of an error