Skip to content

Commit 9ed8d1d

Browse files
committed
Added option to disable redirects, added proxy options
1 parent 685d54c commit 9ed8d1d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/Buildable.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,28 @@ public function query($query)
107107
$this->applyRequestOptions(["query" => $query]);
108108
return $this;
109109
}
110+
111+
/**
112+
* Ignore all redirects for this request
113+
*
114+
* @return $this
115+
*/
116+
public function withoutRedirects()
117+
{
118+
$this->applyRequestOptions(["max_redirects" => 0]);
119+
return $this;
120+
}
121+
122+
/**
123+
* Change proxy for this request
124+
*
125+
* @param string $proxy Proxy value for CURLOPT_PROXY
126+
* @param string $noproxy Comma-separated list of hosts, that do not require proxy
127+
* @return $this
128+
*/
129+
public function proxy($proxy = null, $noproxy = null)
130+
{
131+
$this->applyRequestOptions(["proxy" => $proxy, "no_proxy" => $noproxy]);
132+
return $this;
133+
}
110134
}

0 commit comments

Comments
 (0)