我正在尝试使用Jersey multipart上传文件。这是我的代码:
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
@Path("/test")
public class Tester {
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces
public Response test(@FormDataParam("file") InputStream file, @FormDataParam("file") FormDataContentDisposition fileDetail) {
return Response.status(200).entity(fileDetail.getFileName()).build();
}
}
每次运行此代码时,我都会得到400:
客户发送的请求在语法上是不正确的
修改
https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift