繁体   English   中英

在 android 中发送带有数据(无 json)的 post 请求

[英]Send post request with data ( no json) in volley android

在 android 中,我发送 post 请求(使用 volley)但数据不在 json 中。 例子

 POST /info HTTP/1.1
 Host: test.com
 Cookie: test_web=1234;
 Connection: keep-alive
 Content-Length: 10

 id=123

你能帮助我吗? 提前致谢。

使用 ION 库

dependencies {
    compile 'com.koushikdutta.ion:ion:2.+'
}

用法:

Ion.with(getContext())
.load("https://koush.clockworkmod.com/test/echo")
.setBodyParameter("goop", "noop")
.setBodyParameter("foo", "bar")
.asString()
.setCallback(...)

https://github.com/koush/ion 中的更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM