com.android.volley.Request.getParams()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中com.android.volley.Request.getParams方法的一些代码示例,展示了Request.getParams的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getParams方法的具体详情如下:
包路径:com.android.volley.Request
类名称:Request
方法名:getParams

Request.getParams介绍

[英]Returns a Map of parameters to be used for a POST or PUT request. Can throw AuthFailureError as authentication may be required to provide these values.

Note that you can directly override #getBody() for custom data.
[中]返回用于POST或PUT请求的参数映射。可能会抛出AuthFailureError,因为提供这些值可能需要身份验证。
请注意,对于自定义数据,可以直接重写#getBody()。

代码示例

代码示例来源:origin: mcxiaoke/android-volley

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: mcxiaoke/android-volley

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. Map<String, String> params = getParams();
  12. if (params != null && params.size() > 0) {
  13. return encodeParameters(params, getParamsEncoding());
  14. }
  15. return null;
  16. }

代码示例来源:origin: chentao0707/SimplifyReader

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. Map<String, String> params = getParams();
  12. if (params != null && params.size() > 0) {
  13. return encodeParameters(params, getParamsEncoding());
  14. }
  15. return null;
  16. }

代码示例来源:origin: chentao0707/SimplifyReader

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: jiangqqlmj/FastDev4Android

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. * 如果请求是POST或者PUT方法,去获取请求参数信息,然后设置到请求中
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. //获取请求参数信息
  12. Map<String, String> params = getParams();
  13. if (params != null && params.size() > 0) {
  14. return encodeParameters(params, getParamsEncoding());
  15. }
  16. return null;
  17. }

代码示例来源:origin: jiangqqlmj/FastDev4Android

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: xuningjack/AndroidNet

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * @throws AuthFailureError in the event of auth failure
  5. */
  6. public byte[] getBody() throws AuthFailureError {
  7. Map<String, String> params = getParams();
  8. if (params != null && params.size() > 0) {
  9. return encodeParameters(params, getParamsEncoding());
  10. }
  11. return null;
  12. }

代码示例来源:origin: googolmo/OkVolley

  1. @Override
  2. @Deprecated
  3. protected Map<String, String> getParams() throws AuthFailureError {
  4. return super.getParams();
  5. }

代码示例来源:origin: com.mcxiaoke.volley/library

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. Map<String, String> params = getParams();
  12. if (params != null && params.size() > 0) {
  13. return encodeParameters(params, getParamsEncoding());
  14. }
  15. return null;
  16. }

代码示例来源:origin: com.mcxiaoke.volley/library

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: MewX/light-novel-library_Wenku8_Android

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. Map<String, String> params = getParams();
  12. if (params != null && params.size() > 0) {
  13. return encodeParameters(params, getParamsEncoding());
  14. }
  15. return null;
  16. }

代码示例来源:origin: panxw/android-volley-manager

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: tazimete/android-app-food-delivery-system

  1. /**
  2. * Returns the raw POST or PUT body to be sent.
  3. *
  4. * <p>By default, the body consists of the request parameters in
  5. * application/x-www-form-urlencoded format. When overriding this method, consider overriding
  6. * {@link #getBodyContentType()} as well to match the new body format.
  7. *
  8. * @throws AuthFailureError in the event of auth failure
  9. */
  10. public byte[] getBody() throws AuthFailureError {
  11. Map<String, String> params = getParams();
  12. if (params != null && params.size() > 0) {
  13. return encodeParameters(params, getParamsEncoding());
  14. }
  15. return null;
  16. }

代码示例来源:origin: MewX/light-novel-library_Wenku8_Android

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: jungletian/TitanjumNote

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: AnandChowdhary/saga-android

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: chuyangliu/tastysnake

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: xuningjack/AndroidNet

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: tazimete/android-app-food-delivery-system

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

代码示例来源:origin: tazimete/android-app-food-delivery-system

  1. /**
  2. * Returns a Map of POST parameters to be used for this request, or null if
  3. * a simple GET should be used. Can throw {@link AuthFailureError} as
  4. * authentication may be required to provide these values.
  5. *
  6. * <p>Note that only one of getPostParams() and getPostBody() can return a non-null
  7. * value.</p>
  8. * @throws AuthFailureError In the event of auth failure
  9. *
  10. * @deprecated Use {@link #getParams()} instead.
  11. */
  12. @Deprecated
  13. protected Map<String, String> getPostParams() throws AuthFailureError {
  14. return getParams();
  15. }

相关文章