[PATCH uclient] uclient-fetch: allow to overwrite Content-Type header for POST

Baptiste Jonglez baptiste at bitsofnetworks.org
Sat Jun 19 01:37:58 PDT 2021


Hi,

On 03-06-21, Andre Heider wrote:
> This is required by some APIs, e.g. matrix's media upload [0].
> 
> [0] https://matrix.org/docs/spec/client_server/latest#post-matrix-media-r0-upload


> @@ -484,6 +485,7 @@ static int usage(const char *progname)
>  		"	--user-agent | -U <str>		Set HTTP user agent\n"
>  		"	--post-data=STRING		use the POST method; send STRING as the data\n"
>  		"	--post-file=FILE		use the POST method; send FILE as the data\n"
> +		"	--content-type=STRING		use STRING as Content-Type for the POST method\n"
>  		"	--spider | -s			Spider mode - only check file existence\n"
>  		"	--timeout=N | -T N		Set connect/request timeout to N seconds\n"
>  		"	--proxy=on | -Y on		Enable interpretation of proxy env vars (default)\n"

As far as I can tell, GNU wget does not have such an option.  We try to
stay compatible whenever possible, so adding a new custom option is not
a good idea.

How would you solve this problem with GNU wget?  Reading the man,
--post-data and --post-file are really meant to transmit data in
"application/x-www-form-urlencoded" format, not as arbitrary data.  But if
it is still possible with a custom --header for instance, we should be
able to do the same in uclient-fetch.

Otherwise, maybe curl will do a better job at this.

Regards,
Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210619/8bc9452e/attachment-0001.sig>


More information about the openwrt-devel mailing list