dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:
https://developers.pinterest.com/docs/getting-started/introduction/
Apache License 2.0
173 stars 76 forks source link

Fixed api paths #109

Closed pavelhouzva closed 4 years ago

pavelhouzva commented 4 years ago

Docs - Pinterest Developers

dirkgroenen commented 4 years ago

I'll take a look at this as soon as I get back from my holidays, next week.

pavelhouzva commented 4 years ago

Pinterest API requires "/" at the end of every path. API redirects with 308 HTTP code which is not handled in CurlBuilder. (#110 )

API call: https://api.pinterest.com/v1/me/boards

Response headers:
0:                                  HTTP/2 308 
content-type:                           text/html; charset=utf-8
content-length:                         285
location:                               https://api.pinterest.com/v1/me/boards/
pinterest-generated-by:                 coreapp-ngapi-prod-0a018332
x-envoy-upstream-service-time:          5
cache-control:                          private
date:                               Tue, 21 Jan 2020 12:35:28 GMT
set-cookie:                             _ir=0; Max-Age=1800; HttpOnly; Path=/; Secure
x-cdn:                              akamai
age:                                0

Reponse body:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="https://api.pinterest.com/v1/me/boards/">https://api.pinterest.com/v1/me/boards/</a>.  If not click the link.array(0) {
} 
dirkgroenen commented 4 years ago

Thanks @pavelhouzva. These changes have been released as 0.2.13.