print All request log called from volley library
Asked Answered
B

1

8

I am using volley library to call rest web services and I am using post and get but I don't know why I am sending post and it received as post from the server side so I want to print all requests that are done bu this library like

[30/Jul/2013:12:28:09 +0000] "POST /app HTTP/1.1" 302 0

[30/Jul/2013:12:28:09 +0000] "GET /app/ HTTP/1.1" 200 0

How can I do that ?

enter image description here

I debugged volley and I don't know why the method becomes get , in the request variable the mMethod is 1 and in the connection variable the method becomes Get !

I discovered that there is a redirection from the server side , is it possible that I know if there is a redirection or not from volley

Broadbill answered 27/1, 2014 at 10:22 Comment(3)
do you have the source code of volley?Handclasp
yes I have the source code.Broadbill
if you want to send a Post request through HttpUrlConnection you have to call setDoOutputHandclasp
O
14

Volley prints out information using Log.isLoggable(). This function is kind of weird, so in order to see the volley logs you need to do the following:

  1. (Optional) Change the volley tag to whatever you like using VollyLog.setTag("MyTag"). The default tag is "Volley".
  2. Connect your device to your computer and use the terminal / cmd to call adb shell in the adb location (platform-tools library by default).
  3. In the adb shell type the following command: setprop log.tag.MyTag VERBOSE ("MyTag" should be replaced with whatever your tag is according to step 1).

The Volley logs will now be printed out.

Note that this sometimes gets reset, so you'll need to do it again. I think whenever you restart your phone.

Outdated answered 29/1, 2014 at 8:1 Comment(1)
Does not print the headers stillJeneejenei

© 2022 - 2024 — McMap. All rights reserved.