hprose-php icon indicating copy to clipboard operation
hprose-php copied to clipboard

Es17"Wrong Request

Open fengerwoo opened this issue 4 years ago • 13 comments

浏览器访问服务端报错

Es17"Wrong Request: "z

fengerwoo avatar Mar 01 '20 02:03 fengerwoo

项目是Mac电脑刚刚新建的,不应该存在BOM头

fengerwoo avatar Mar 01 '20 02:03 fengerwoo

Wrong Request 不是 BOM 的问题,是请求无效。你的请求是空的。

andot avatar Mar 01 '20 04:03 andot

@andot 那怎么测试服务端启动成功了?

我用PostMan POST访问就是

Es17"Wrong Request:
"z

用客户端就是timeout

fengerwoo avatar Mar 02 '20 07:03 fengerwoo

你POST的内容是什么?

andot avatar Mar 02 '20 07:03 andot

你POST的内容是什么?

无论post有没有参数都会报这个结果,对参数格式有什么要求吗,在本地请求的,是不是需要在外网环境下进行测试?

15237179193 avatar May 22 '20 08:05 15237179193

参数格式跟你服务器端选择的编码器有关。如果是默认的编码器,那么POST的内容需要是 hprose 格式的请求。如果是增加了 JSONRPC 编码器,那 POST 的内容可以是 JSONRPC 格式的内容。

andot avatar May 22 '20 09:05 andot

参数格式跟你服务器端选择的编码器有关。如果是默认的编码器,那么POST的内容需要是 hprose 格式的请求。如果是增加了 JSONRPC 编码器,那 POST 的内容可以是 JSONRPC 格式的内容。

在浏览器下不带参数是可以的,但是postman工具请求就会报Wrong Request,这是为什么呢?如果想携带参数那该怎么在浏览器上测试呢???

15237179193 avatar May 23 '20 07:05 15237179193

https://hprose.com/test/ 这里有个很久之前做的测试工具,你可以试试看。

andot avatar May 23 '20 07:05 andot

https://hprose.com/test/ 这里有个很久之前做的测试工具,你可以试试看。

这个工具测试的是项目在外网环境的吗,本地不能用吧?

15237179193 avatar May 23 '20 08:05 15237179193

能用,打开跨域就可以。本质上它是从浏览器来访问你的服务,不是从服务端访问你的服务。所以你是内网也没关系。

andot avatar May 23 '20 08:05 andot

我也是啊 postman调用报这个错 post方式 里边啥也没传

zxh451200 avatar Jun 26 '20 03:06 zxh451200

postman请求接口报错,哪位大佬指点下: Es17"Wrong Request: "z 代码是走到这里了 image

liaoqiang321 avatar Sep 19 '21 13:09 liaoqiang321

postman请求接口报错,哪位大佬指点下: Es17"Wrong Request: "z 代码是走到这里了 image

大部分情况下是 php 文件用了带 BOM 的 UTF8 编码造成的。去掉 BOM 就好了。

andot avatar Sep 23 '21 03:09 andot