Can anyone please help me with this.
I created a web service using resteasy with wildfly 8.1.0 but @FormParam always returns null.
UserService.java
Path("/user")
@Produces(MediaType.APPLICATION_JSON)
public class UserService {
@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/create")
public String create(@FormParam("first_name") String firstName, @FormParam("last_name") String lastName,
@FormParam("email") String email, @FormParam("username") String username,
@FormParam("password") String password, @FormParam("address") String address,
@FormParam("country") String country, @FormParam("zip") String zip, @FormParam("ssnlast4") String ssnlast4,
@FormParam("mobile") String mobile, @FormParam("dob_month") String dobMonth,
@FormParam("dob_year") String dobYear, @FormParam("reg_type") String regType,
@FormParam("avatar") String avatar) {
String str = firstName + ":" + lastName + ":" + email + ":" + username + ":" + password + ":" + address + ":" + country + ":" + zip+ ":" + ssnlast4 + ":" + mobile;
return str;
}
}
I use POSTMAN
to test the service.
return will be {null:null:null:null:null:null:null:null:null:null}
Thanks. I appreciate it.