bearbeitet Codeschlecht Anfrage 400 Fehler bei Amazon api Zugang
foreach($parsed_xml->OperationRequest->Errors->Error as $error){
echo "Error code: " . $error->Code . "\r\n";
echo $error->Message . "\r\n"; echo "\r\n";
}
}
function printSearchResults($parsed_xml, $SearchIndex){
print("<table>");
if($numOfItems>0){
foreach($parsed_xml->Items->Item as $current){
print("<td><font size='-1'><b>".$current->ItemAttributes->Title."</b>");
if (isset($current->ItemAttributes->Title)) {
print("<br>Title: ".$current->ItemAttributes->Title);
} elseif(isset($current->ItemAttributes->Author)) {
print("<br>Author: ".$current->ItemAttributes->Author);
} elseif(isset($current->Offers->Offer->Price->FormattedPrice)){
print("<br>Price:".$current->Offers->Offer->Price->FormattedPrice);
}else{
print("<center>No matches found.</center>");
}
}
}
}
if (!isset($params["Timestamp"])) {
$params["Timestamp"] = gmdate('Y-m-d\TH:i:s\Z');
}
ksort($params);
$pairs = array();
foreach ($params as $key => $value) {
array_push($pairs, rawurlencode($key)."=".rawurlencode($value));
}
$canonical_query_string = join("&", $pairs);
$string_to_sign = "GET\n".$endpoint."\n".$uri."\n".$canonical_query_string;
$signature = base64_encode(hash_hmac("sha256", $string_to_sign, $aws_secret_key, true));
$request_url = 'http://'.$endpoint.$uri.'?'.$canonical_query_string.'&Signature='.rawurlencode( $signature);
echo "Signed URL: \"".$request_url."\"";
}
function fetchDataUsingAPI($UniqueBatchId) {
echo $this->firstpageurl;
if(isset($_POST['datafetchresume'])){
$lastbatchdetails = GetTaskLastBatchDetails($_GET['taskid']);
$UniqueBatchId = $lastbatchdetails[0];
$this->firstpageurl = $lastbatchdetails[1];
}else {
$this->firstpageurl = $this->ItemSearch($categorySplit[1],$UniqueBatchId);
}
SaveTaskLastBatchDetails($_GET['taskid'], $UniqueBatchId, $this- >firstpageurl);
return $UniqueBatchId;
Dies ist keine Frage.,. bitte formatieren Sie den Code, schränken Sie das Problem ein und fügen Sie echte Sätze hinzu. – DanFromGermany