当 REST API 映射到 Java 对象时,它采用输入内容类型:application/x-www-form-urlencoded,例如
public class MyRequest {
@JsonProperty("my_name")
private String myName;
@JsonProperty("my_phone")
private String myPhone;
//Getters and Setters of myName and myPhone.
}
Run Code Online (Sandbox Code Playgroud)
在表单输入请求中,我设置了 my_name 和 my_phone 的值,但 MyRequest 对象的 myName 和 myPhone 为 null。
我正在使用 Jackson-annotations 2.3 jar
有什么建议可能有什么问题吗?