/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns which encoding should be used when converting POST parameters returned by * {@link #getPostParams()} into a raw POST body. * * <p>This controls both encodings: * <ol> * <li>The string encoding used when converting parameter names and values into bytes prior * to URL encoding them.</li> * <li>The string encoding used when converting the URL encoded parameters into a raw * byte array.</li> * </ol> * * @deprecated Use {@link #getParamsEncoding()} instead. */ @Deprecated protected String getPostParamsEncoding() { return getParamsEncoding(); }
/** * Returns which encoding should be used when converting POST parameters returned by * {@link #getPostParams()} into a raw POST body. * * <p>This controls both encodings: * <ol> * <li>The string encoding used when converting parameter names and values into bytes prior * to URL encoding them.</li> * <li>The string encoding used when converting the URL encoded parameters into a raw * byte array.</li> * </ol> * * @deprecated Use {@link #getParamsEncoding()} instead. */ @Deprecated protected String getPostParamsEncoding() { return getParamsEncoding(); }
/** * Returns which encoding should be used when converting POST parameters returned by * {@link #getPostParams()} into a raw POST body. * * <p>This controls both encodings: * <ol> * <li>The string encoding used when converting parameter names and values into bytes prior * to URL encoding them.</li> * <li>The string encoding used when converting the URL encoded parameters into a raw * byte array.</li> * </ol> * * @deprecated Use {@link #getParamsEncoding()} instead. */ @Deprecated protected String getPostParamsEncoding() { return getParamsEncoding(); }
/** * Returns the raw POST or PUT body to be sent. * * <p>By default, the body consists of the request parameters in * application/x-www-form-urlencoded format. When overriding this method, consider overriding * {@link #getBodyContentType()} as well to match the new body format. * * @throws AuthFailureError in the event of auth failure */ public byte[] getBody() throws AuthFailureError { Map<String, String> params = getParams(); if (params != null && params.size() > 0) { return encodeParameters(params, getParamsEncoding()); } return null; }
/** * Returns the raw POST or PUT body to be sent. * * <p>By default, the body consists of the request parameters in * application/x-www-form-urlencoded format. When overriding this method, consider overriding * {@link #getBodyContentType()} as well to match the new body format. * * @throws AuthFailureError in the event of auth failure */ public byte[] getBody() throws AuthFailureError { Map<String, String> params = getParams(); if (params != null && params.size() > 0) { return encodeParameters(params, getParamsEncoding()); } return null; }
/** * Returns the raw POST or PUT body to be sent. * 如果请求是POST或者PUT方法,去获取请求参数信息,然后设置到请求中 * <p>By default, the body consists of the request parameters in * application/x-www-form-urlencoded format. When overriding this method, consider overriding * {@link #getBodyContentType()} as well to match the new body format. * * @throws AuthFailureError in the event of auth failure */ public byte[] getBody() throws AuthFailureError { //获取请求参数信息 Map<String, String> params = getParams(); if (params != null && params.size() > 0) { return encodeParameters(params, getParamsEncoding()); } return null; }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ /* * 该方法的出现是为了 新版本中废弃的 getPostBodyContentType() 方法 * * 获取该 请求的 POST 或 PUT 请求 body 的 Content-Type */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the content type of the POST or PUT body. */ public String getBodyContentType() { createHttpEntityIfNeed(); if(mBody!=null){ return mBody.getContentType().getValue(); } return "application/x-www-form-urlencoded; charset=" + getParamsEncoding(); }
/** * Returns the raw POST or PUT body to be sent. * * @throws AuthFailureError in the event of auth failure */ public byte[] getBody() throws AuthFailureError { Map<String, String> params = getParams(); if (params != null && params.size() > 0) { return encodeParameters(params, getParamsEncoding()); } return null; }