3xx passed through by default; follow_redirects() to chase them.
3xx passed through by default; follow_redirects() to chase them.
#include <asio.hpp>
#include <iostream>
int main() {
asio::io_context io;
const std::string bounce =
"https://postman-echo.com/redirect-to?url=https://postman-echo.com/get";
std::cout <<
"without follow: http " << res.
http_code_ <<
"\n";
});
std::cout <<
"with follow: http " << res.
http_code_ <<
"\n";
});
io.run();
}
RequestBuilder & follow_redirects(long max=30)
Definition cofetch.h:362
auto get(CompletionToken &&token)
Definition cofetch.h:372
RequestBuilder request(std::string url)
Start a fluent request chain: request(url).body(...).post(token).
Definition cofetch.h:412
auto async_get(std::string url, CompletionToken &&token)
Definition cofetch.h:324
long http_code_
Definition cofetch.h:176