When running normal post operations I use the following code:
$request = Request::factory($url)->method(Request::POST)->post($params);
$response = $request->execute();
I’m not sure what it is I need to change though to enable me to POST a json string instead of an array variable.
My json string is basically created using the json_encode() function on an array of parameters, like so:
$params = array(
'var1' => $var1,
'var2' => $var2,
// etc
);
$json = json_encode($params);
Any help would be greatly appreciated.
I have found these solutions.
Using PUT:
Using POST:
From here: http://kohanaframework.org/3.2/guide/kohana/requests#external-requests