简体   繁体   English

通过 gson 从请求正文中获取 json

[英]Get json from request body by gson

How I can get json request body?如何获得 json 请求正文?

   App.getApi().method(data).enqueue(new Callback<Obj>() {
        @Override 
        public void onResponse(Call<Obj> call, Response<Obj> response){
             // print here 
        }
        ...
   };

If you are trying to print request / response while using retrofit you can enable logging check this article for same.如果您在使用 retrofit 时尝试打印请求/响应,您可以启用日志记录检查这篇文章是否相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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