简体   繁体   English

如何使用 Postman 为复合键发送 POST 请求

[英]How do I send a POST request using Postman for a composite key

How do I send a POST request using Postman for a composite key?如何使用 Postman 为复合键发送 POST 请求? my composite key is:"favoritePK" which contains "id_ad" and "id_customer".我的复合键是:“favoritePK”,其中包含“id_ad”和“id_customer”。 i need your help我需要你的帮助

I think there is no problem in your code.我认为您的代码没有问题。 Your entity must contain both the fields id_ad, id_customer.您的实体必须同时包含 id_ad、id_customer 字段。 Just send any request with both fields like:只需发送包含两个字段的任何请求,例如:

{
    id_ad: 1,
    id_customer:2,
    "name": "Someone Singh",
    "bio": "Testing",
    "dob": "1998-02-01"
}

And at the receiving end use @RequestBody with entity.并在接收端使用 @RequestBody 和实体。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的 POST URL 上出现状态 400,错误请求(使用邮递员) - Why do I get Status 400, Bad Request on my POST URL (using postman) 我如何使用rest模板Spring发送带有谷歌番石榴多地图数据的发布请求? - How do i send a post request with Google guava Multi-map data using rest template Spring? 如何使用 Spring data JPA 和 Hibernate 添加复合外键? - How do I add composite foreign key using Spring data JPA and Hibernate? Spring boot 的 Postman Post 请求保存了整个 JSON 正文,而不仅仅是字段值。 我该如何解决? - Postman Post request for Spring boot saves the entire JSON body instead of just the field value. How do I fix this? 如何在 postman 多部分/表单数据发布请求中将应用程序/json 数据与文件一起发送? - How to send application/json data along with file in postman multipart/form-data post request? 如何发送 postman Map 密钥为 object? - How to send in postman Map with key as object? 与 Postman 一起工作时无法通过表单发送 POST 请求 - Cannot send POST request via form while it's work with Postman 如何创建一个同时包含基元和复合主键作为表复合键 (Spring JPA) 的 JoinTable? - How do I create a JoinTable which includes both a primitive and a composite primary key as the tables composite key (Spring JPA)? angular 4 post请求不起作用,但邮递员能够发送邮件请求到spring boot服务器吗? - angular 4 post request not working, but postman is able to send post request to spring boot server? 如何使用WebClient反应式Web客户端发送带有zip正文的POST请求 - How can I send POST request with zip body using WebClient reactive web client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM