Thursday, September 3, 2009

MySpace is working (for now)

I had a minor brain wave while researching another API today. The documentation stated that all requests must include a user agent header, which got me thinking about the MySpace problem.

Because it uses oAuth (and must send an oAuth header) it uses a different cURL function than most other feeds. That cURL function was not applying a user agent field. I corrected it and....no change. So I began debugging and outputting values throughout the authorization process and it all-of-a-sudden began to work.

So, could have been some sort of delay or caching problem keeping the old cURL function file for a few minutes after I uploaded the change. Or it could be that changing the user agent field has temporarily fixed a firewall blocking problem. Maybe it will work for a day then just stop, as it did when I first uploaded it.

But for now, it's working.

Please, try it out and let me know if you encounter any problems.

No comments:

Post a Comment