package com.game.webgame.network;
import java.util.HashMap;
import java.util.Map;


import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
/**
 * Created by Administrator on 2017/4/24.
 */

public class CustomStringRequest extends Request<String>{
    private Map<String, String> mHeaders=new HashMap<String, String>();

    public CustomStringRequest(String url, ErrorListener listener) {
        super(url, listener);

    }

    public CustomStringRequest(int method, String url, ErrorListener listener) {
        super(method, url, listener);

    }

    @Override
    protected void deliverResponse(String arg0) {

    }

    @Override
    protected Response<String> parseNetworkResponse(NetworkResponse Response) {
        //在这里可以的到 response 对象， 然后从response的header中获取cookie信息

        return null;
    }

    public void setCookie(String cookie) {

        mHeaders.put("Cookie", cookie);
    }

    @Override
    public Map<String, String> getHeaders() throws AuthFailureError {

        return mHeaders;
    }
}
