Toonify

FREEMIUM
Durch Toonify | Aktualisiert לפני 22 ימים | Video, Images
Popularität

9.4 / 10

Latenz

12,501ms

Service Level

100%

Health Check

N/A

Zurück zu allen Diskussionen

java code

Rapid account: Amrmohamed 81298
amrmohamed81298
לפני 3 שנים

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 לפני שנה

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 שנים

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();

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen