Toonify

FREEMIUM
By Toonify | Updated hace un mes | Video, Images
Popularity

9.4 / 10

Latency

12,602ms

Service Level

100%

Health Check

N/A

Back to All Discussions

java code

Rapid account: Amrmohamed 81298
amrmohamed81298
il y a 3 ans

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 il y a un an

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 il y a 3 ans

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

Join in the discussion - add comment below:

Login / Signup to post new comments