File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -408,14 +408,24 @@ impl AgentBuilder {
408
408
///
409
409
/// If the redirect count hits this limit (and it's > 0), TooManyRedirects is returned.
410
410
///
411
+ /// WARNING: for 307 and 308 redirects, this value is ignored for methods that have a body.
412
+ /// You must handle 307 redirects yourself when sending a PUT, POST, PATCH, or DELETE request.
413
+ ///
411
414
/// ```
412
415
/// # fn main() -> Result<(), ureq::Error> {
413
416
/// # ureq::is_test(true);
414
417
/// let result = ureq::builder()
415
418
/// .redirects(1)
416
419
/// .build()
417
- /// .get("http://httpbin.org/redirect/3")
418
- /// .call();
420
+ /// .get("http://httpbin.org/status/301")
421
+ /// .error_on_non_2xx(false)
422
+ /// .call()?;
423
+ /// assert_ne!(result.status(), 301);
424
+ ///
425
+ /// let result = ureq::put("http://httpbin.org/status/307")
426
+ /// .error_on_non_2xx(false)
427
+ /// .send_bytes(b"some data")?;
428
+ /// assert_eq!(result.status(), 308);
419
429
/// # Ok(())
420
430
/// # }
421
431
/// ```
You can’t perform that action at this time.
0 commit comments