0

My POST method looks like this:

@POST
@Path("DeleteBiometric")
@Consumes({ MediaType.MULTIPART_FORM_DATA, ("text/plain") })
@Produces(MediaType.TEXT_PLAIN)
public Response DeleteBiometric(
        @FormDataParam("client") String Client,
        @FormDataParam("RmBiometricId") String RmBiometricId){
    System.out.println("Client "+Client);
    System.out.println("RmBiometricId "+RmBiometricId);
    return Response.ok().entity("uno").build();
}

I´m using java jersey.

When running this test using POSTMAN, It gives the output uno

enter image description here

but using Meteor.http.call() in a method from Server, my code is not working. My Meteor code:

  ByPost: function() {
    var options={
      params:{
        "client": "68b8asas",
        "RmBiometricId":"5ad8e72e27c5e45a984514fc"
      }
    };
    HTTP.call('POST','http://localhost:8080/restdemo/jaxrs/customers/DeleteBiometric',options,function(error, result) {
      if(result){
        console.log("resultado "+JSON.stringify(result))
      }
    });
  }

The output from console server:

enter image description here

  • Doesn't look like you're sending a multipart body in the request. 415 means that the content-type is wrong. I've never used Meteor, but have you Googled how to send multipart with Meteor? – Paul Samsotha Apr 24 '18 at 03:10
  • As an aside, if you are not sending any files (which is what Multipart is for), then why don't you just use `application/x-www-form-urlencoded` data? Then you would use `@FormParam` instead of `@FormDataParam` – Paul Samsotha Apr 24 '18 at 03:13
  • See also [What is difference between @FormDataParam and @FormParam](https://stackoverflow.com/a/37537693/2587435) – Paul Samsotha Apr 24 '18 at 03:18

0 Answers0