【问题标题】:Retrofit debug, generate network request information改造调试,生成网络请求信息
【发布时间】:2015-01-15 09:58:37
【问题描述】:

我正在使用改造来发出一些网络请求,但不确定要使用哪个@annotation,我设法使用 PostMan Utility 成功请求,但无法在 android 应用程序上得到正确的请求。因此,我想从网络检查器进行调试。

如何使用我的 Android 应用程序/模拟器生成与以下类似的日志/报告?

POST /path/to/api/ HTTP/1.1
Content-Length: [length]
Content-Type: multipart/form-data; boundary=iSBcxYW-SeE_dubqNJw3p6PP59WbDOAj

--iSBcxYW-SeE_dubqNJw3p6PP59WbDOAj
Content-Disposition: form-data; name="file"

test
--iSBcxYW-SeE_dubqNJw3p6PP59WbDOAj--

【问题讨论】:

    标签: android networking retrofit


    【解决方案1】:

    您可以设置日志级别以在您的适配器中查看日志以进行改造:-

     RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(your_url_endpoint)
                .setRequestInterceptor(requestInterceptor)
                .setLogLevel(RestAdapter.LogLevel.FULL)
                .setLog(new AndroidLog("your log tag"))
                .build();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-14
      • 1970-01-01
      • 2022-10-15
      • 2015-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多