system/curl: add a small curl-like HTTP client command#3651
Merged
Conversation
Add the "curl" NSH command: a command-line HTTP client built on top of the netutils webclient library. It implements a subset of the real curl options: GET and POST (and other methods via -X), custom request headers (-H), a raw request body (-d, including -d @file), multipart/form-data file uploads (-F name=@file), saving the response body to a file (-o) and verbose output (-v). HTTP only (no HTTPS). Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
jerpelea
approved these changes
Jul 20, 2026
cederom
approved these changes
Jul 20, 2026
Contributor
|
@xiaoxiang781216 maybe now we can remove the netutils/libcurl4nx that Sebastien started to implement and never finished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a small
curl-like HTTP client command undersystem/curl, built on topof the
netutils/webclientlibrary. It brings the familiarcurloptionsyntax to the NuttShell so HTTP servers can be exercised directly from the
target.
Supported options (a subset of the real curl, see https://curl.se/docs/manpage.html):
-X <method>: HTTP method (defaults to GET, or POST when a body is sent)-H <header>: add a request header-d <data>/-d @file: raw request body (inline or read from a file)-F name=@file: multipart/form-data file upload-o <file>: write the response body to a file-v: verboseHTTP only (no HTTPS).
Impact
CONFIG_SYSTEM_CURL(defaultn); no impactwhen disabled.
CONFIG_NETUTILS_WEBCLIENT/CONFIG_NET_TCP.Testing
arm-none-eabi-gcclinum-stm32h753bi:curl(companion NuttX PR adds this config), STM32H753BI over Ethernet + SD cardnxstyleclean onsystem/curl/curl_main.c.Runtime on hardware: