wonwoo / spring-social-pinterest

spring-social-pinterest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create pins base64

fwshngtn opened this issue · comments

According to the pinterest api documentation you have to provide "image","image_url" or "image_base64". (1 of 3)
https://developers.pinterest.com/docs/api/pins/

Currently you always add "image_base64" to the parameters list,even if its not set. This makes it impossible to create a pin by "image" or "image_url" only.
I would suggest to add "image_base64" only if it is set.

    if (image_base64 != null) {
        parameters.add("image_base64", image_base64);
    }

With that fix it works fine to create a new pin by just providing an "image_url".

hi

if (image_base64 != null) {
        parameters.add("image_base64", image_base64);
}

and

image property : String -> org.springframework.core.io.Resource

thanks!