简体   繁体   中英

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

In android I send post request ( use volley) but data not in json. Example

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

 id=123

Can you help me? Thanks in advance.

Use ION library

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

usage:

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

further information in https://github.com/koush/ion

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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