You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while using Postman to test an image upload to freeimage.host, it works as supposed to.
But when I use Java code, it fails. Maybe it is a bug, but i am not sure since the same code works for imgbb.com!
POSTMAN
POST: https://freeimage.host/api/1/upload/
PARAMS: key=6d207e02198a847aa98d0a2a901485a5
BODY: source=an image filename from local filesystem
JAVA
File f = new File(an image filename from local filesystem);
HttpRequest httpRequest = HttpRequest.post( "https://freeimage.host/api/1/upload/" )
.part("key", apikey)
.part("source", f.getName(), f)
.send("");
or
File f = new File(an image filename from local filesystem);
HttpRequest httpRequest = HttpRequest.post( "https://freeimage.host/api/1/upload/" )
.part("key", apikey)
.part("source", f.getName(), f);
httpRequest,code();
Java fails with HTTP response status code 403.
The text was updated successfully, but these errors were encountered:
Hello,
while using Postman to test an image upload to freeimage.host, it works as supposed to.
But when I use Java code, it fails. Maybe it is a bug, but i am not sure since the same code works for imgbb.com!
POSTMAN
POST: https://freeimage.host/api/1/upload/
PARAMS: key=6d207e02198a847aa98d0a2a901485a5
BODY: source=an image filename from local filesystem
JAVA
File f = new File(an image filename from local filesystem);
HttpRequest httpRequest = HttpRequest.post( "https://freeimage.host/api/1/upload/" )
.part("key", apikey)
.part("source", f.getName(), f)
.send("");
or
File f = new File(an image filename from local filesystem);
HttpRequest httpRequest = HttpRequest.post( "https://freeimage.host/api/1/upload/" )
.part("key", apikey)
.part("source", f.getName(), f);
httpRequest,code();
Java fails with HTTP response status code 403.
The text was updated successfully, but these errors were encountered: