【发布时间】:2019-05-16 10:14:45
【问题描述】:
我用 Java 编程,我使用运动衫
我想将由 6800 个字符组成的 json 传递给我的网络服务
最初我把它作为一个查询参数,但它没有工作。 然后我用 HeaderParam 进行更改,但它还不起作用。 我该怎么办?
@Path("InsertSconti")
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String InsertCustomer(@HeaderParam("token") String token,@QueryParam("customer") String customer)
{
http://localhost:8087/clayapi/restservices/InsertCustomer?customer=json(6800 个字符)
它给了我错误 400 Bad Request
【问题讨论】:
-
使用
POST请求而不是GET? -
没有工作是什么意思?
-
但它不起作用
-
它给了我错误 400 错误请求
-
你用的是什么框架?你用什么语言编程?请学习如何创建minimal reproducible example 向我们展示。也请阅读how to ask good questions,以及this question checklist。
标签: json rest web-services