Closed fatihmert closed 9 years ago
It looks like methods on that class are used statically, so I don't think it would make sense to register it with Flight.
If you're using composer you're better off installing Requests that way and then you can just use the class without having to load or register it.
Hmm, @philo23 thank you. I am not using composer.
So @philo23 How can I do get sample url address with flight request method? Can you show me a sample pattern?
Thank you again.
@fatihmert Flight::request
return you request from the browser to your application. In other words, if your user visits /
it will give you all information about this request, like headers, path, method, parameters passed, etc.
@tamtamchik ok. I understood.
Thank you for fast answer.
@fatihmert try this out. You don't need to do extra lines to make it work with Flight. It should work out of the box.
require_once 'lib/Requests.php'; //Request
Requests::get('http://ryanmccue.info/', array('Accept' => 'text/html'));
Also as a tip. Try Guzzle.
In what situation would you register a class vs just including/using it as is?
Hello,
I want register this class to flight, http://requests.ryanmccue.info/
Error this;
Fatal error: Call to private Requests::__construct() from context 'flight\core\Loader' in /opt/lampp/htdocs/flightphp-learn/flight/core/Loader.php on line 123
If It can be override flightphp request class, It's ok.
Thank you for interest.