Commit 9b167fd0 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

--request-target: instead of --strip-path-slash

... and CURLOPT_REQUEST_TARGET instead of CURLOPT_STRIP_PATH_SLASH.

This option instead provides the full "alternative" target to use in the
request, instead of extracting the path from the URL.

Test 1298 and 1299 updated accordingly.

Idea-by: Evert Pot
Suggestion: https://daniel.haxx.se/blog/2017/06/19/options-with-curl/comment-page-1/#comment-18373

Closes #1593
parent 8de8f4eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,6 +42,6 @@ DPAGES = abstract-unix-socket.d anyauth.d append.d basic.d cacert.d capath.d cer
  tlsauthtype.d tlspassword.d tlsuser.d tlsv1.0.d tlsv1.1.d tlsv1.2.d   \
  tlsv1.3.d tlsv1.d trace-ascii.d trace.d trace-time.d tr-encoding.d    \
  unix-socket.d upload-file.d url.d use-ascii.d user-agent.d user.d     \
  verbose.d version.d write-out.d xattr.d strip-path-slash.d
  verbose.d version.d write-out.d xattr.d request-target.d

OTHERPAGES = page-footer page-header
+8 −0
Original line number Diff line number Diff line
Long: request-target
Help: Specify the target for this request
Protocols: HTTP
---
Tells curl to use an alternative "target" (path) instead of using the path as
provided in the URL. Particularly useful when wanting to issue HTTP requests
without leading slash or other data that doesn't follow the regular URL
pattern, like "OPTIONS *".
+0 −7
Original line number Diff line number Diff line
Long: strip-path-slash
Help: Strip off the first slash of the path
Protocols: HTTP
---
Tells curl to strip the leading slash from the path when it sends the path to
the server. Useful when wanting to issue HTTP requests without leading slash,
like "OPTIONS *".
+2 −2
Original line number Diff line number Diff line
@@ -303,8 +303,8 @@ Start a new cookie session. See \fICURLOPT_COOKIESESSION(3)\fP
Add or control cookies. See \fICURLOPT_COOKIELIST(3)\fP
.IP CURLOPT_HTTPGET
Do a HTTP GET request. See \fICURLOPT_HTTPGET(3)\fP
.IP CURLOPT_STRIP_PATH_SLASH
Cut off the leading slash from the path. \fICURLOPT_STRIP_PATH_SLASH(3)\fP
.IP CURLOPT_REQUEST_TARGET
Set the request target. \fICURLOPT_REQUEST_TARGET(3)\fP
.IP CURLOPT_HTTP_VERSION
HTTP version to use. \fICURLOPT_HTTP_VERSION(3)\fP
.IP CURLOPT_IGNORE_CONTENT_LENGTH
+1 −1
Original line number Diff line number Diff line
@@ -108,4 +108,4 @@ Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space.
.SH "SEE ALSO"
.BR CURLOPT_HTTPHEADER "(3), " CURLOPT_NOBODY "(3), "
.BR CURLOPT_STRIP_PATH_SLASH "(3), "
.BR CURLOPT_REQUEST_TARGET "(3), "
Loading