Skip to content

请求 正文

Screenshot


在请求正文中发送数据


请求正文是客户端发送到API的数据。

无论何时需要修改API中的数据,您都需要发送带有请求的正文数据。

例如,当发送向大学数据库添加新学生的请求时,您可能会在JSON中包含该学生的数据。

选择以下方法时,通常会使用主体部分:

  • PUT
  • POST
  • PATCH

PostPanda中的Body选项卡允许您指定需要随请求发送的数据。您可以从下拉菜单中选择各种不同的正文数据内容类型,以适合您的API。


内容类型


默认情况下,如果您不需要随请求发送正文,PostPanda将选择None并保持选中状态。

Content Type Function
application/json Indicates that the request body format is JSON.
application/Id + json For JSON-LD
application/hal+json To Respond to APIs requiring mediatype for HyperText Application Language
application/ vnd.api + json The application/vnd.api+json MIME type is reserved for communication using the JSON API protocol.
application/xml Indicates that the request body format is XML.
application/x-www-form-url-encoded describes form data that is sent in a single block in the HTTP message body
multipart/form-data message body is divided into parts, each containing a discrete section of data.Each part can contain a different content type; for example, text/plain, image/png, image/gif
text/html The text/html content type is an Internet Media Type as well as a MIME content type
text/plain The text/plain content type is the generic subtype for plain text.