Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url ="http://localhost:8080/bugzilla/rest/bug";
- $apikey = "IZC4rs2gstCal0jEZosFjDBRV9AQv2gF0udh4hgq";
- $data = array(
- "product" => "TestProduct",
- "component" => "TestComponent",
- "version" => "unspecified",
- "summary" => "This is a test bug - please disregard",
- "alias" => "SomeAlias",
- "op_sys" => "All",
- "priority" => "P1",
- "rep_platform" => "All"
- );
- $str_data = json_encode($data);
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS,$str_data);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER,
- array("Content-Type: application/json", "Accept: application/json"));
- $username = "ashish.sureka@in.abb.com";
- $password = "abbincrc";
- curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
- $result = curl_exec($ch);
- curl_close($ch);
- echo $result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement