Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. $ch = curl_init();
  2. $jsonString = json_encode( $data );
  3. curl_setopt( $ch, CURLOPT_POSTFIELDS, $jsonString );
  4. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
  5. curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7. curl_setopt($ch, CURLOPT_HEADER, false);
  8. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  9. 'Content-Type: application/json; charset=utf-8',
  10. 'Content-Length: ' . strlen($jsonString))
  11. );
  12. curl_setopt($ch, CURLOPT_URL, $url);
  13. $respond = curl_exec($ch);
  14.  
  15. Request starting HTTP/1.1 PUT [URI] application/json; charset=utf-8 477
  16. Executing action method [ACTION] with arguments (500, [MODEL]) - ModelState is Valid
  17.  
  18. Request starting HTTP/1.1 PUT [URI] application/json; charset=utf-8 0
  19. Executing action method [ACTION] with arguments (246, ) - ModelState is Invalid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement