$client = new Guzzle\Http\Client();
$request = $client->post('http://foo.com',
array(
'Content-Type' => 'application/x-www-form-urlencoded',
'Content-Length' => 'length'
),array(
'foo'=>'bar',
'Data' => array(
'LD'=> array(
'ld1'=>1
),
'PD'=>array(
'pd1'=>Input::get('pd1'),
'pd2'=> Input::get('pd2'),
'pd3'=>Input::get('pd3')
),
'CD'=>array(
'cd1'=>Input::get('cd1'),
'cd2'=>Input::get('cd2'),
'cd3'=>Input::get('cd3')
)
));
When passing a string instead of an array to Data e.g:
<LD>
<ld1>qwerty</ld1>
</LD>
<PD>
<pd1>qwerty</pd1>
<pd2>qwerty</pd2>
<pd3>qwerty</pd3>
</PD>
<CD>
<cd1>qwerty</cd1>
<cd2>qwerty</cd2>
<cd3>qwerty</cd3>
</CD>
The request works fine and returns the XML as expected.
I have no idea what i'm doing wrong. Hopefully someone with more experience can help.