How can I send an URI with " " or \\ in it?
Magiranu opened this issue · 1 comments
Magiranu commented
Hi @ALL
The idea is to send terms like bob
& \\apples
to a server. I get this error:
Fatal error: Maximum execution time of 30 seconds exceeded
Here is my function:
public function index($request, $response)
{
$uri = 'http://example.org/folder?key=["bob", "\\apples"];
$content = \Httpful\Request::get($uri)->send();
return $content;
}
The mysterious thing is, that it works with only one term (?key="bob") but with two it doesn't. When I put the URL into my browser, I get back the proper results (JSON response) with one and with two terms. So at the end it works but Httpful does something I don't know of yet. Would you please be so kind and shed some light on it? :-)
Magiranu commented
Alright, I got this figured out at the end. I needed to encode the unicode text like this:
[
--> %5B
]
--> %5D
"
--> %22
,
--> %2C
Hope this will help anyone in the future.
Thanks guys!