Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Integracja z API SendOwl
m-mike
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 8.09.2010

Ostrzeżenie: (0%)
-----


Cześć
Mam taki kod:
  1. <?php
  2.  
  3. $key = 'xxxxx'; // my own
  4. $secret = 'yyyyy'; // my own
  5. $url = 'https://' . $key . ':' . $secret . '@www.sendowl.com/api/v1/products/';
  6. $ch = curl_init($url);
  7. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
  8. $output = curl_exec( $ch );
  9. curl_close($ch);
  10. echo "output:".$output;
  11. ?>


A ich API mi odpowiada:
Please specify a supported `Accept` header. Valid options: `application/json`, `application/xml`

Co może być nie tak? Dzięki za wszelkie podpowiedzi.
Michal
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
m-mike
post
Post #2





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 8.09.2010

Ostrzeżenie: (0%)
-----


Próbowałem tez przez https://apitester.com/, ale tu dzieje się dokładnie tak samo:

Response Headers
HTTP/1.1 301 Moved Permanently
Date: Sun, 06 May 2018 10:20:28 GMT
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dc9cc1af67e8c14d3b683380ba36e90141525602028; expires=Mon, 06-May-19 10:20:28 GMT; path=/; domain=.sendowl.com; HttpOnly
Location: https://www.sendowl.com/api/v1/products
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 416ab6e35a5d57b3-IAD

Response Body
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
<script src="/cdn-cgi/apps/head/oR54GLIzrz0H2Yq5frMVrw6eZGY.js"></script></head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.sendowl.com/api/v1/products">here</a>.</p>
</body></html>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 18:29