PhpStorm HTTP请求返回404,除非它们是GET或POST类型

时间:2017-11-14 01:12:42

标签: php curl phpstorm

OPTIONS request through PHP Storms built in rest client 返回:

<!doctype html><title>404 Not Found</title><h1 style="text-align: center">404 Not Found</h1><hr/><p style="text-align: center">PhpStorm 2017.2.4</p>

GET request through PHP Storms built in rest client

返回:

Reached File
200

PHP文件只是

<?php
echo "Reached File\n";
echo http_response_code(200);

使用curl(或任何其他发送HTTP请求的方法)展示了相同的行为

GET:

curl http://localhost:63342/CSCD-378%20-%20Web%20Development/CSCD-378/5-REST/api/v1/vin/index.php

POST:

curl -X OPTIONS http://localhost:63342/CSCD-378%20-%20Web%20Development/CSCD-378/5-REST/api/v1/vin/index.php

PhpStorm配置为使用/ usr / bin / php作为解释器

PhpStorm版本2016.2.4
OS = Linux Mint 18.2

0 个答案:

没有答案