android studio中的RemoveBG API

问题描述

他们的官方文档(https://www.remove.bg/api)已经给出了这个java代码

Response response = Request.Post("https://api.remove.bg/v1.0/removebg")
                    .addHeader("X-Api-Key","INSERT_YOUR_API_KEY_HERE")
                    .body(
                            multipartentityBuilder.create()
                                    .addBinaryBody("image_file",file)
                                    .addTextBody("size","auto")
                                    .build()
                    ).execute();
            response.saveContent(new File("no-bg.png"));

它还指出它需要 Apache HttpComponents 才能工作......我在 gradle 文件添加了它的实现,但随后它给出了错误

httpclient defines classes that conflict with classes Now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example,for httpclient use HttpUrlConnection or okhttp instead),or repackaging the library using something like jarjar.

请告诉我如何实现这一点,提供完整的代码以及填写“image_file”、“size”和“auto”标签内容

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)