How can I display all the HTTP Headers when using the DefaultHTTPClient?

后端 未结 5 996
太阳男子
太阳男子 2020-12-30 12:21

When using the DefaultHttpClient() from the Apache Commons HTTP Client, is it possible to show the full request in the console output for debugging purposes?

5条回答
  •  独厮守ぢ
    2020-12-30 13:14

    If you are using Logback as your logging framework, add the following configuration to your logback.xml / logback-test.xml file:

    
    
    
    
        
    
        
    
        
    
    
    

    Having added this configuration, Logback's log appenders will now show useful HttpClient-related information about HTTP request and response headers, among other things.

提交回复
热议问题