Skip to content

User-Agent doesn't get set #2

Closed
DiogoNeves opened this Issue Sep 28, 2010 · 8 comments

2 participants

@DiogoNeves

User-Agent doesn't get set on any request I make.

This happens in Chrome and Mozilla running on Linux.

@jmathai
Owner
jmathai commented Sep 28, 2010

The user agent should be set for all of the curl calls. See http://github.com/jmathai/foursquare-async/blob/master/EpiOAuth.php#L126

Closing for now. If you can provide a specific case where it's not being set then let me know.

@DiogoNeves

It is very probable I'm making a mistake, I'm just starting with web development and some concepts are very new to me yet :)
I was setting the user-agent variable to something else but when looking at firebug it says I was using the default FireFox string...
I'll look at this again tomorrow :)

Thanks

@jmathai
Owner
jmathai commented Sep 28, 2010

No problem. The useragent string that foursquare-async uses is never visible to the end user. It's sent to the twitter api only. The end user will not see anything different from other calls to your server.

The flow looks like this. So as far as the end user is concerned, they're always only talking to your server as normal.

Your computer -> your server -> twitter -> your server -> your computer

@DiogoNeves

Wow, that makes sense :)
Now I'm feeling stupid hehe, this was a simple one...
I'm now printing the headers to confirm everything is good and it seems to be, is there any other way of confirming/testing this?

Thanks :)

@jmathai
Owner
jmathai commented Sep 29, 2010

Not sure what you mean about confirming and testing. If the call fails then the library will throw an exception as you access the results. If no exception is thrown then you can assume everything went ok since it means that Foursquare returned a HTTP 200 status code.

Because of this you'll want your code to be in a try/catch block. See the documentation for details: http://github.com/jmathai/foursquare-async/wiki#exceptions

@DiogoNeves

Sorry, didn't explain properly.
I mean, in general, how would you check which information is being sent on a server-server request, for debugging purposes?
Just general curiosity :)

Thanks again :) and by the way, congratulations :)

@jmathai
Owner
jmathai commented Sep 29, 2010

Well, your server decides what information is being sent as part of the call to the Foursquare api. You can access any attributes of the response to see what Foursquare sent back to you. As far as debugging, you can print_r, var_dump, error_log or anything you choose.

@DiogoNeves

Great, thanks :)
That's what I'm doing then, I was just confirming if there was some other technique I was missing :)

Cheers

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.