Search
⌃K
README
How to read this book
The cURL project
Network and protocols
Install curl
Source code
Build curl
Command line basics
Using curl
HTTP with curl
FTP with curl
Using libcurl
Header files
Easy handle
Drive transfers
Connection reuse
Callbacks
Cleanup
Name resolving
Proxies
Post transfer info
Share data between handles
URL API
Include files
Create, cleanup, duplicate
Parse a URL
Redirect to a relative URL
Get a URL
Get individual URL parts
Set individual URL parts
Append to the query
CURLOPT_CURLU
WebSocket
API compatibility
--libcurl
Global initialization
multi-threading
curl easy options
CURLcode return codes
Verbose operations
Caches
libcurl examples
for C++ programmers
HTTP with libcurl
Bindings
libcurl internals
Index
Powered By GitBook

Redirect to a relative URL

When the handle already has parsed a URL, setting a second relative URL will make it "redirect" to adapt to it.
Example, first set the original URL then set the one we "redirect" to:
CURLU *h = curl_url();
rc = curl_url_set(h, CURLUPART_URL,
"https://example.com/foo/bar?name=moo", 0);
​
rc = curl_url_set(h, CURLUPART_URL, "../test?another", 0);
Previous
Parse a URL
Next
Get a URL
Last modified 1yr ago
Export as PDF
Copy link
Edit on GitHub