java - Retrofit Log for outgoing POST request does not match incoming packet -
i trying send post request remote django server via retrofit. have created log restadapter retrofit when monitor log, notice request being sent correctly post:
---> http post http://[omitted ip]/users/login_user/?username=lucas&platform=and&client_version=1.0 content-type: application/x-www-form-urlencoded; charset=utf-8 content-length: 18 password=abcd12345 ---> end http (18-byte body) but received on server (according tcpdump) request.
i can send same request using curl:
curl -x post -h "content-type: application/x-www-form-urlencoded; charset=utf-8" -d 'password=abcd12345' "http://[omitted ip]:22800/users/login_user/?username=lucas&platform=and&client_version=1.0" and results in post request being received server, processes correctly.
here post packet tcpdump via curl:
05:54:25.849761 ip [omitted ip].dsl.teksavvy.com.53549 > 192.168.0.150.22080: flags [p.], seq 1:251, ack 1, win 229, options [nop,nop,ts val 9311380 ecr 191199659], length 250 e...;.@.8.cqe........-v@a./.........f9..... .....ey.post /users/login_user/?username=lucas&platform=and&client_version=1.0 http/1.1 user-agent: curl/7.32.0 host: [omitted ip]:22800 accept: */* content-type: application/x-www-form-urlencoded; charset=utf-8 content-length: 18 password=abcd12345 and think should pretty same packet (but isn't) tcpdump via retrofit:
05:57:40.801738 ip [omitted ip].dsl.teksavvy.com.55429 > 192.168.0.150.22080: flags [p.], seq 1:320, ack 1, win 229, options [nop,nop,ts val 45578792 ecr 191219119], length 319 e..s.g@.8...e.........v@.h...........i..... ..z(.e..get /users/login_user/?username=lucas&platform=and&client_version=1.0 http/1.1 content-type: application/x-www-form-urlencoded; charset=utf-8 user-agent: dalvik/1.6.0 (linux; u; android 4.2.1; galaxy nexus build/jop40d) host: [omitted ip]:22800 connection: keep-alive accept-encoding: gzip content-length: 18 where packet changed? packets recorded in tcpdump after potentially being modified application layer? or retrofit lying , sending request? ideas on how debug problem further appreciated.
i resolved problem changing endpoint url from: endpoint-address.com www.endpoint-address.com. that's server redirect www-less address seemed screw post requests.
Comments
Post a Comment