Recently, curl author Daniel Stenberg plans to add native JSON support to curl,
and gave three reasons.
- Sending JSON is common practice in areas like REST APIs
- "Easy to use JSON" is a common answer when asked about the considerations people choose for curl alternatives
- On sites like Stack Overflow, many people can't use curl to send correct JSON and quote JSON correctly because JSON uses double quotes and the shell doesn't expand variables within single quotes
Daniel said that since he doesn't send JSON very often, it was not appropriate for him to design this feature entirely. He needs more help from others to make this feature as useful as possible.
In short, Daniel plans to add two command line options:
- Send formatted JSON as a shortcut for -d with matching Accept header
- Build JSON request body for sending
Currently Daniel has drafted his updated concepts in the curl wiki and created a discussion board. Interested friends can actively participate in the discussion.
curl wiki link: https://github.com/curl/curl/wiki/JSON
Discussion forum link: https://github.com/curl/curl/discussions/8312
About cURL
cURL is an open source project. The main products are curl (command line tool) and libcurl (C language API library). Both functions are: based on network protocols, network transmission of specified URLs.
curl is a file transfer tool that works from the command line using URL syntax, first released in 1997. It supports file upload and download, so it is a comprehensive transfer tool. curl includes libcurl for program development, can handle authentication pages in various situations, such as interactively asking users to enter passwords, etc., and is currently available under the MIT license.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。