如果你不需要处理文件上传或其他类型的 multipart
请求,而是只需要处理普通的表单数据或 JSON 数据,你可以将请求的 Content-Type 设置为 application/x-www-form-urlencoded
或 application/json
。
例如,如果你使用 Postman 进行请求,选择合适的 Body 类型并设置正确的 Content-Type。如果你使用 cURL,确保使用 -H "Content-Type: application/x-www-form-urlencoded"
或 -H "Content-Type: application/json"
来设置请求头。