Toonify

FREEMIUM
От Toonify | Обновлено 16일 전 | Video, Images
Популярность

9.4 / 10

Задержка

12,262ms

Уровень обслуживания

100%

Health Check

N/A

Назад ко всем обсуждениям

java code

Rapid account: Amrmohamed 81298
amrmohamed81298
3 years ago

i bought the API but the java code on the rapidapi is not working so could you provide the correct java code as i really need it for my graduation project

Rapid account: Zeesigntech
zeesigntech Commented a year ago

i am trying this in postman but geting below error
{
“detail”: [
{
“loc”: [
“body”,
“image”
],
“msg”: “field required”,
“type”: “value_error.missing”
}
]
}

Rapid account: Justinpinkney
justinpinkney Commented 3 years ago

Here is some code I generated using postman which uses the okhttp library

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("image","lawrence.jpg",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("somefile.jpg")))
  .build();
Request request = new Request.Builder()
  .url("https://toonify.p.rapidapi.com/v0/toonify")
  .method("POST", body)
  .addHeader("x-rapidapi-key", "YOUR_RAPID_API_KEY_HERE")
  .addHeader("x-rapidapi-host", "toonify.p.rapidapi.com")
  .build();
Response response = client.newCall(request).execute();

Присоединяйтесь к обсуждению – добавьте комментарий ниже:

Войдите / Зарегистрируйтесь, чтобы публиковать новые комментарии