fork download
  1. <?php
  2. $curl = curl_init();
  3.  
  4. CURLOPT_URL => 'http://localhost:8000/ai-testing/api/endpoints/create/',
  5. CURLOPT_RETURNTRANSFER => true,
  6. CURLOPT_ENCODING => '',
  7. CURLOPT_MAXREDIRS => 10,
  8. CURLOPT_TIMEOUT => 0,
  9. CURLOPT_FOLLOWLOCATION => true,
  10. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  11. CURLOPT_CUSTOMREQUEST => 'POST',
  12. CURLOPT_POSTFIELDS =>'{
  13. "project_uuid": "99e0f65c-90ef-4fc9-b06c-be063b839d8c",
  14. "name": "Test Endpoint",
  15. "method": "POST",
  16. "path": "/test/hemant",
  17. "description": "This is a test hemant",
  18. "headers": {
  19. "Content-Type": "application/json1"
  20. },
  21. "params": {
  22. "key": "value1"
  23. },
  24. "body": "{\\"test2\\": \\"data\\"}",
  25. "body_type": "json"
  26. }',
  27. CURLOPT_HTTPHEADER => array(
  28. 'Content-Type: application/json'
  29. ),
  30. ));
  31.  
  32. $response = curl_exec($curl);
  33.  
  34. curl_close($curl);
  35. echo $response;
  36. ?>
Success #stdin #stdout 0.03s 25772KB
stdin
Standard input is empty
stdout