[Symfony] crawler get request parameter setting
Having been bit a couple times with the way Guzzle client aggregates parameters, although I like the spirit of this request I think introducing it into Goutte’s foundation is likely to cause more problems/confusions than it solves.
For example, if you had:
$params = array(
‘a’ => ‘a’,
‘b’ => ‘b’,
);
$crawler = $client->request(‘GET’, ‘http://www.example.com/?c=c’, $params);
Would you expect http://www.example.com/?c=c&a=a&b=b to be loaded, or http://www.example.com/?a=a&b=b ? Furthermore things become really hairy when you start trying to plan for query array values.
‘a’ => ‘a’,
‘b’ => ‘b’,
);
$crawler = $client->request(‘GET’, ‘http://www.example.com/?c=c’, $params);
Would you expect http://www.example.com/?c=c&a=a&b=b to be loaded, or http://www.example.com/?a=a&b=b ? Furthermore things become really hairy when you start trying to plan for query array values.
Although it restrains the functionality of Goutte/BrowserKit/Guzzle, wouldn’t this be best since you’d have complete control and understanding of what you are about to access:
$params = array(
‘a’ => ‘a’,
‘b’ => ‘b’,
);
$crawler = params));
‘a’ => ‘a’,
‘b’ => ‘b’,
);
$crawler = params));
up vote
8
down vote
accepted
According to the RFC 2616, it’s not forbidden to use the request body in GET requests.
However, I’d like to know of an client implementation which does send data in the body and an server implementation which parses data in the body of GET requests.
8
down vote
accepted
According to the RFC 2616, it’s not forbidden to use the request body in GET requests.
However, I’d like to know of an client implementation which does send data in the body and an server implementation which parses data in the body of GET requests.
So basically, no, the Content-Type header is not used.
留言
張貼留言