如何使用post方法上传带有参数android的图像(How to upload a image with parameters android with post method)

系统教程 行业动态 更新时间:2024-06-14 16:59:47
如何使用post方法上传带有参数android的图像(How to upload a image with parameters android with post method)

我正在关注此链接上传图片。 我成功发送图像。

但是如何使用相同的请求发送一些参数。

我想发送这些参数

String urlFormation = WebConstants.UPLOAD_IMAGE; Log.i(TAG, "urlFormation: ======"+urlFormation); URL url = new URL(urlFormation); // Open a HTTP connection to the URL conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("user_id", userID); conn.setRequestProperty("release_id", releaseID);

请帮帮我。 谢谢

I am following this link to upload a image. I am successfully sending image.

But how to send some parameters with same request.

These parameters i want to send

String urlFormation = WebConstants.UPLOAD_IMAGE; Log.i(TAG, "urlFormation: ======"+urlFormation); URL url = new URL(urlFormation); // Open a HTTP connection to the URL conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("user_id", userID); conn.setRequestProperty("release_id", releaseID);

Please help me. Thank you

最满意答案

好的方法是使用GET

yourscript.php?parm1=somevalue&param2=someothervalue

如果您想要POST ,可以将数据附加到请求正文。

Well the easy way is to use GET

yourscript.php?parm1=somevalue&param2=someothervalue

If you wanted POST you can append the data to the body of the request.

更多推荐

本文发布于:2023-04-17 08:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/90e26f503989437d71b458d12b865bc0.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   图像   参数   上传   方法

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!