Hi,
I believe this is a very simple question. However, I have been searching for over an hour to little success.
Within my application I need to make a web request to a URL. For example, I may want to get some event data from a Facebook event (in which case I should somehow make a request to https :// graph.facebook.com/331218348435 and in return I’ll get some JSON with the data I need). I want to do a basic HTTP GET request. But, I can’t figure out how to do this.
My questions are:
- How do I make a HTTP GET request using best practices?
- For example, I could use cURL, but that seems more console oriented. I could use file_get_contents but that seems hacky. Are there other ways?
- Is there a Yii way of making such a request?
As REST-ful APIs seem to be such a big part of web-development, I can’t imagine there isn’t a simple way to do this. And, to be honest, I’m kind of embarrassed to ask!
Thank you for your help.
I’ve really enjoyed my (small) development with Yii. On top of being a great framework (I did an extensive search about 8 months ago), it has taught me a lot.