curl: error out if -T and -d are used for the same URL

As one implies PUT and the other POST, both cannot be used
simultaneously.

Add test 378 to verify.

Reported-by: Boris Verkhovskiy
Fixes #8704
Closes #8715
This commit is contained in:
Daniel Stenberg 2022-04-17 11:18:16 +02:00
parent 6968fb9d54
commit 01a1697a79
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 54 additions and 6 deletions

39
tests/data/test378 Normal file
View file

@ -0,0 +1,39 @@
<testcase>
<info>
<keywords>
HTTP PUT
HTTP POST
</keywords>
</info>
#
# Server-side
<reply>
</reply>
#
# Client-side
<client>
<server>
none
</server>
<name>
Reject using -T and -d at once
</name>
<command>
-T log/%TESTNUMBER -d input http://never-accessed
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
2
</errorcode>
<stderr mode="text">
Warning: You can only select one HTTP request method! You asked for both PUT
Warning: (-T, --upload-file) and POST (-d, --data).
</stderr>
</verify>
</testcase>