头图

curl author Daniel Stenberg plans to add native JSON support to curl

六一
中文

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.

阅读 1.1k

SegmentFault_行业快讯
第一时间为开发者提供行业相关的实时热点资讯
avatar
六一
SegmentFault 新媒体运营

SegmentFault 新媒体运营

411 声望
335 粉丝
0 条评论
avatar
六一
SegmentFault 新媒体运营

SegmentFault 新媒体运营

411 声望
335 粉丝
文章目录
宣传栏