How to upload a File to a REST api
I try to use am building a document management service from with a RESTful API.
@Path("fileUpload")
public class FileUploadService
{
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response uploadFile(@FormDataParam("file") InputStream fileStream,
@FormDataParam("file") FormDataContentDisposition fileDetail) throws IOException
{
....
}
}
It seems to work as expected if I use a third party provider. It has a client such as Postman. However, when using the REST API, but somehow activity of ivy I am not able to send a valid request with a file from ivy.
unable to call this service. I always get errors stating the the header `X-Request-By` `X-Requested-By` is missing. Whats the issue? How can I send files using REST?a REST Client Call activity?