Archived Forum Post

Index of archived forum posts


Posting large json with curl

Aug 09 '17 at 12:06

Hi, i want to reproduce this curl request (PHP) with chilkat in

$parameters = array( 'action' => 'import', 'controller' => 'Defect', ); $url .= '&'.http_build_query(array('tx_itkdefectdetector_frontend' => $parameters)); $curlArray = array( CURLOPT_POST => 1, CURLOPT_POSTFIELDS => array('tx_itkdefectdetector_frontend[jsonData]'=>$jsonData), CURLOPT_FOLLOWLOCATION => 1, CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => 10, CURLOPT_VERBOSE => 1, ); $curl = curl_init($url); curl_setopt_array($curl, $curlArray);

the url is something like this[actio n]=import&tx_itkdefectdetector_frontend[controller]=Defect&tx_itkdefectdetector_frontend[jsonD ata]={jsonData}

The json is in string form, but can have image data (base64_encode)m included in the post, so it becomes to long for an URL request.

Can someone point me to the correct way posting it from code in




See this example:

Set each of the request query params by calling req.AddParam, including the case for the large JSON document.