tp5 route problem
XY
XY 2019-02-13 23:41:38
0
3
1191

I would like to ask everyone for advice. I have just learned tp5 not long ago. Now I have a route problem. After turning on routing

think\Route::rule('xxx/client/login.php', 'admins.php/admins/Account/login');

In the browser url It can be accessed normally, but an exception is thrown when using httpwebrequest to send a post request: Internal error 500.

What is the cause?

XY
XY

reply all(1)
航航

tp5's route.php is used to define routes with get, post, resource and other methods. If the route is correctly defined and the web page can be accessed but the interface tool cannot request it, you can try adding Content-type: application/ in the header. x-www-form-urlencodedRequest

  • reply Web access is normal. After the route takes effect, the original URL will become invalid. request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; request.ServicePoint.Expect100Continue = false; It works fine without routing code, but it reports 500 error when routing is used.
    XY author 2019-02-15 19:04:37
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template