Moon
Moon

Reputation: 22565

How to pass an URL as a query string?

I'm trying to pass an url to a controller.

http://something/index.php/api/http%3A%2F%2Fengadget.com

I get 404 Not Found error.

My route

Route::any("/api/{url}", "ApiController@parse");

How do I configure a route or controller to make it work?

Upvotes: 0

Views: 672

Answers (2)

Juni Samos De Espinosa
Juni Samos De Espinosa

Reputation: 393

How about without the / in front of "api"?

Upvotes: 0

Anujan
Anujan

Reputation: 938

Route::any("/api/(:all)", "ApiController@parse");

http://laravel.com/docs/routing#wildcards

You use (:all) to catch the rest of the URI

Upvotes: 1

Related Questions