rest - Trying to make an API request using PHP with AWS Route53 -


i need make 1 api request aws route53 create reusable delegation set. can't through console web interface, has through api.

here documentation making api request: http://docs.aws.amazon.com/route53/latest/apireference/api-create-reusable-delegation-set.html

<?php $baseurl = "route53.amazonaws.com/2013-04-01/delegationset"; $body = '<?xml version="1.0" encoding="utf-8"?>     <createreusabledelegationsetrequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">        <callerreference>whitelabel dns</callerreference>     </createreusabledelegationsetrequest>';  $ch = curl_init();                // set query data here url curl_setopt($ch, curlopt_url, $baseurl); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_post,           1 ); curl_setopt($ch, curlopt_postfields,     $body );  curl_setopt($ch, curlopt_httpheader,     array('host: route53.amazonaws.com','x-amzn-authorization: '));  curl_setopt($ch, curlopt_timeout, '3'); $rest = curl_exec($ch);  if ($rest === false) { // throw new exception('curl error: ' . curl_error($crl));  print_r('curl error: ' . curl_error($ch)); } curl_close($ch); print_r($rest);  ?> 

i know request isn't signed/authenticated, i'm not able connect server. @ least error message says i'm not authenticated before continue. instead "connection refused".

i'm sure i'm doing wrong here. google has been of no use.

scrowler right. changed:

$baseurl = "route53.amazonaws.com/2013-04-01/delegationset"; 

to

$baseurl = "https://route53.amazonaws.com/2013-04-01/delegationset"; 

i got error message expecting , can work on next step.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -