buzzsprout / buzzsprout-api

The official documentation for the Buzzsprout API (http://www.buzzsprout.com).
48 stars 10 forks source link

Cors Issue working locally and bad credentials when using postman or pasting the url to browser #33

Closed rsd-earl closed 1 year ago

rsd-earl commented 1 year ago

i'm currently making a script that would get all the episodes and would display it but when i tried doing so i'm getting CORS Issues. Screenshot-1

but when i try using postman i'm getting bad credentials same with pasting the url to browser. Screenshot from 2023-01-10 11-29-33 Screenshot from 2023-01-10 11-36-06

eric-hansen commented 1 year ago

Based on your screenshots you're sending an Authorization header in Postman, but passing it via URI in the browser. Why not try the same method both ways to see if the outcome is the same?

johnloringpollard commented 1 year ago

Send the param as api_token instead of token. Also if you send the token as a param you do not need the authorization header.

rsd-earl commented 1 year ago

Based on your screenshots you're sending an Authorization header in Postman, but passing it via URI in the browser. Why not try the same method both ways to see if the outcome is the same?

I have tried this locally sending a request to episodes.json with the Authorization header and it gives me CORS.

I'll try both today.

rsd-earl commented 1 year ago

@johnloringpollard okay the api_token works, but gives me CORS issue when putting it in the script that I'm making

rsd-earl commented 1 year ago

@johnloringpollard for reference here's the code Screenshot-4

johnloringpollard commented 1 year ago

What happens if you run that code in the console at stackoverflow or buzzsprout.com? It works for me there which makes me wonder if theres something blocking from visual studio.

rsd-earl commented 1 year ago

@johnloringpollard still gives me CORS issue Screenshot-5

rsd-earl commented 1 year ago

@johnloringpollard any comment on this ?

johnloringpollard commented 1 year ago

I believe the issue is that you need to use the full domain. https://www.buzzsprout.com You are not using the www. portion.

rsd-earl commented 1 year ago

thank you @johnloringpollard didn't think that would be an issue, but it seems like, I was wrong.