error while connecting from API [closed]

asked 2013-12-04 03:33:23 -0600

anonymous user

Anonymous

Hi

I'm using curl command in php to connect horizon. you can check the error with given link.

http://znetrocks.com/admin/test/openstack/open_stack_2.php

and the code is given below.

$request = ' <auth xmlns="http://103.247.97.1:5000/v2.0/tokens" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <passwordcredentials password="xyz" username="xyz"> </passwordcredentials></auth>';

// Create Headers //$header[] = "Host: http://103.247.97.1:5000/v2.0/tokens%22 (http://103.247.97.1:5000/v2.0/tokens") ; $header[] = "Content-type: text/xml"; //$header[] = "Content-length: ".strlen($request) . "\r\n"; $header[] = $request;

// Send using CURL $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, "http://103.247.97.1:5000/v2.0/tokens"); // URL to post curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); // headers from above curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$request);

$result = curl_exec( $ch ); // runs the post print_r($result); curl_close($ch);

?>

edit retag flag offensive reopen merge delete

Closed for the following reason too localized by dheeru
close date 2013-12-06 00:27:45.230000

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-12-06 00:21:52 -0600

harish gravatar image

Hi,

Now issue resolved.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-12-04 03:33:23 -0600

Seen: 261 times

Last updated: Dec 06 '13