Giter Site home page Giter Site logo

405: Method Not Allowed about hprose-php HOT 6 CLOSED

hprose avatar hprose commented on May 2, 2024
405: Method Not Allowed

from hprose-php.

Comments (6)

pavlelee avatar pavlelee commented on May 2, 2024

这应该和你用的框架有关吧,https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405

from hprose-php.

lscgzwd avatar lscgzwd commented on May 2, 2024

405是nginx输出的,如果请求打到了一个静态文件上,并且是post请求就会这样,检查下nginx配置吧

from hprose-php.

ycaihappy avatar ycaihappy commented on May 2, 2024

楼上说的没错,但是如果hprose能支持GET请求(默认好像都是POST的?)静态资源这个问题是可以解决的。

这样的应用场景比较多,当nginx要实现伪静态时,大部分都是类似xx.html, xxx/xx/这种地址,不支持的话应付不了很多场景,apache也是类似。

from hprose-php.

pavlelee avatar pavlelee commented on May 2, 2024

@ycaihappy 你没看明白,伪静态是可以可以的,但是这个明显是你的nginx配置错误,Client必须请求到一个Serve,请确认这个请求'http://xxxx/wus/v1/'能否到Serve

from hprose-php.

lscgzwd avatar lscgzwd commented on May 2, 2024

贴出你的nginx配置一看就知道了。这个肯定是rewrite配置不对,导致请求没有到hprose上 或者说没有到php-fpm

from hprose-php.

ycaihappy avatar ycaihappy commented on May 2, 2024

@Liv1020 http://xxxx/wus/v1/ 是可以得到服务结果的。。
@lscgzwd nginx配置是正确的。。

问题已经解决。原因是使用lumen框架的时候路由注册的是GET,改成POST就可以了。谢谢大家关注。

POST /wus/v1/ HTTP/1.1" 405 没改lumen前
POST /wus/v1/ HTTP/1.1" 200 修改lumen后

from hprose-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.