[GH-ISSUE #20] 关于Post请求 #14

Closed
opened 2026-03-03 11:55:20 +03:00 by kerem · 5 comments
Owner

Originally created by @lovelykd on GitHub (Oct 12, 2020).
Original GitHub issue: https://github.com/Finb/bark-server/issues/20

目前的Get和Post请求都是将title/body/category等内容放在URL里面,我感觉对于Post请求,将它们封装为json payload更为合适

curl -d '{"title":"123", "body": "hello world"}' -H "Content-Type: application/json" -X POST https://api.day.app/:key/
Originally created by @lovelykd on GitHub (Oct 12, 2020). Original GitHub issue: https://github.com/Finb/bark-server/issues/20 目前的Get和Post请求都是将title/body/category等内容放在URL里面,我感觉对于Post请求,将它们封装为json payload更为合适 ``` curl -d '{"title":"123", "body": "hello world"}' -H "Content-Type: application/json" -X POST https://api.day.app/:key/ ```
kerem 2026-03-03 11:55:20 +03:00
Author
Owner

@mritd commented on GitHub (Oct 12, 2020):

@Finb 我要不要彻底重写一下?
@lovelykd 这个锅是 @Finb 的

<!-- gh-comment-id:707218966 --> @mritd commented on GitHub (Oct 12, 2020): @Finb 我要不要彻底重写一下? @lovelykd 这个锅是 @Finb 的
Author
Owner

@Finb commented on GitHub (Oct 13, 2020):

title/body 除了可以放在 path 和 query 里
也能放在 POST Data 里的

curl -d 'title=123&body=hello world'  -X POST https://api.day.app/:key/
<!-- gh-comment-id:707482004 --> @Finb commented on GitHub (Oct 13, 2020): title/body 除了可以放在 path 和 query 里 也能放在 POST Data 里的 ``` curl -d 'title=123&body=hello world' -X POST https://api.day.app/:key/ ```
Author
Owner

@lovelykd commented on GitHub (Oct 13, 2020):

了解,谢谢你们的回复

<!-- gh-comment-id:707584507 --> @lovelykd commented on GitHub (Oct 13, 2020): 了解,谢谢你们的回复
Author
Owner

@mritd commented on GitHub (Oct 13, 2020):

其实我一直觉得应该换个正经的 web 框架,轻量级的 router 啥的 😅

<!-- gh-comment-id:707600204 --> @mritd commented on GitHub (Oct 13, 2020): 其实我一直觉得应该换个正经的 web 框架,轻量级的 router 啥的 😅
Author
Owner

@DarrenSong commented on GitHub (Sep 28, 2021):

目前的Get和Post请求都是将title/body/category等内容放在URL里面,我感觉对于Post请求,将它们封装为json payload更为合适

curl -d '{"title":"123", "body": "hello world"}' -H "Content-Type: application/json" -X POST https://api.day.app/:key/

-X 后面的内容不需要加引号吗?

<!-- gh-comment-id:928656600 --> @DarrenSong commented on GitHub (Sep 28, 2021): > 目前的Get和Post请求都是将title/body/category等内容放在URL里面,我感觉对于Post请求,将它们封装为json payload更为合适 > > ``` > curl -d '{"title":"123", "body": "hello world"}' -H "Content-Type: application/json" -X POST https://api.day.app/:key/ > ``` -X 后面的内容不需要加引号吗?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bark-server#14
No description provided.