Laravel 5.6.15不想接受我的帖子请求

时间:2018-04-13 13:04:24

标签: php laravel postman crud

我写了一条接受邮寄请求的路线:

Route::post('/imageprocessor', 'ImageProcessorController@processImage');

和Postman我发送了一个请求帖给http://queue_processor.local/imageprocessor回来:

MethodNotAllowedHttpException

和响应标题:

Cache-Control →no-cache, private
Connection →keep-alive
Content-Type →text/html; charset=UTF-8
Server →nginx/1.13.3
Transfer-Encoding →chunked
allow →GET, HEAD
date →Fri, 13 Apr 2018 12:57:17 GMT

我的路线列表是:

+--------+----------+----------------+------+------------------------ 
------------------------------------+------------+
| Domain | Method   | URI            | Name | Action                                                     
| Middleware |
+--------+----------+----------------+------+------------------------ 
------------------------------------+------------+
|        | GET|HEAD | /              |      | Closure                                                    
| web    |
|        | POST     | imageprocessor |      | 
App\Http\Controllers\ImageProcessorController@processImage | web        
|
+--------+----------+----------------+------+------------------------ 
------------------------------------+------------+

出了什么问题?

1 个答案:

答案 0 :(得分:0)

您需要允许发送跨源资源共享标头 您可能想要连接此库 https://github.com/barryvdh/laravel-cors