欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

php curl 自己亲自做的 立讯的 curl 的 工作日志 每天登记事项 有大用 有大大用 有大大大用

function custom_twenty_batch_works_batch_works()
{
 $str ='{"listItemCreateInfo":{"__metadata":{"type":"SP.ListItemCreationInformationUsingPath"},"FolderPath":{"__metadata":{"type":"SP.ResourcePath"},"DecodedUrl":"/Lists/List1"}},"formValues":[{"FieldName":"Title","FieldValue":"123","HasException":false,"ErrorMessage":null},{"FieldName":"_x9009__x9879_","FieldValue":";#账号;#","HasException":false,"ErrorMessage":null},{"FieldName":"a5ec","FieldValue":"[{\"Key\":\"i:0#.w|bbbb\\\\1xxxx739\",\"Description\":\"BBBB\\\\1xxxx739\",\"DisplayText\":\"Pingzhong Shi(史平忠)\",\"EntityType\":\"User\",\"ProviderDisplayName\":\"Active Directory\",\"ProviderName\":\"AD\",\"IsResolved\":true,\"EntityData\":{\"Title\":\"\",\"MobilePhone\":\"\",\"SIPAddress\":\"\",\"Department\":\"技術支持一課,125614,智能装置产品集群(SDBG)\",\"Email\":\"Pingzhong.Shi@xxxx-yyy.com\"},\"MultipleMatches\":[]}]","HasException":false,"ErrorMessage":null},{"FieldName":"_x95ee__x9898__x63cf__x8ff0_","FieldValue":"qwer","HasException":false,"ErrorMessage":null},{"FieldName":"_x662f__x5426__x89e3__x51b3_","FieldValue":"1","HasException":false,"ErrorMessage":null},{"FieldName":"ContentType","FieldValue":"项目","HasException":false,"ErrorMessage":null}],"bNewDocumentUpdate":false,"checkInComment":null}';
//  $arr = drupal_json_decode($str);
//  var_dump($arr);exit;

 $curl = curl_init();
 $url = "http://js1p-es-xxxx/_api/web/GetList(@a1)/AddValidateUpdateItemUsingPath()?@a1=%27%2FLists%2FList1%27";
 curl_setopt_array($curl, array(
     CURLOPT_URL => $url,
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => $str)
);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
 var_dump($response);
 var_dump($err);
}


普通分类: