Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- $jsonString = json_encode( $data );
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $jsonString );
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json; charset=utf-8',
- 'Content-Length: ' . strlen($jsonString))
- );
- curl_setopt($ch, CURLOPT_URL, $url);
- $respond = curl_exec($ch);
- Request starting HTTP/1.1 PUT [URI] application/json; charset=utf-8 477
- Executing action method [ACTION] with arguments (500, [MODEL]) - ModelState is Valid
- Request starting HTTP/1.1 PUT [URI] application/json; charset=utf-8 0
- Executing action method [ACTION] with arguments (246, ) - ModelState is Invalid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement