0

I have a following curl command that works fine on mac command line/terminal:

curl -X POST http://build:f9280f220bf7b75396f83a0@mobile-jenkins.domain.com:8080/job/qa-trserver-git/build
--data-urlencode json='{"parameter": [{"name":"POST_RESULTS", "value":"true"}, {"name":"RUN_ID", "value":"744"}, {"name":"PLAN", "value":"SamplePlan"}]}'

How to use this curl command in php program?

Something I can think of:

<?php

 curl -X POST http://build:f9280f220bf7b75396f83a0@mobile-jenkins.domain.com:8080/job/qa-trserver-git/build
--data-urlencode json='{"parameter": [{"name":"POST_RESULTS", "value":"true"}, {"name":"RUN_ID", "value":"744"}, {"name":"PLAN", "value":"SamplePlan"}]}'

?>

An example with the input will be helpful.

Pratik Jaiswal
  • 309
  • 7
  • 26
  • Thanks for pointing this as duplicate. I think `$cmd='curl....'` `exec($cmd,$result);` should work for me. How about if I have some vars in the curl command?. Not sure if I can make a comment on the post that you are pointing to. – Pratik Jaiswal Jun 27 '16 at 23:23
  • @Dagon any thoughts on my comment above ? – Pratik Jaiswal Jun 27 '16 at 23:38

0 Answers0