简体   繁体   English

“ 406不可接受”问题的解决方案是什么?

[英]What is the solution to the “406 Not Acceptable” problem?

i have error #406 Not Acceptable 我有错误#406不可接受

just when i add "url" http:// on end api url like this: 只是当我在最终的api网址上添加“ url” http://时,就像这样:

http://sl.abudayah.com/api.php?create=http:// http://sl.abudayah.com/api.php?create=http://

how can me fix it ? 我该如何解决?

What is the solution to the "406 Not Acceptable" problem ? 解决“ 406不可接受”问题的解决方案是什么?

It's probably best to encode the parameter being passed. 最好对传递的参数进行编码。 If you're using PHP to generate your URLs, go with rawurlencode : 如果您使用PHP生成URL,请使用rawurlencode

$url .= 'create=' . rawurlencode('http://'); // or however you get the appropriate string

If your link is being generated in another language or by hand, you'll need to look up the appropriate means of encoding it. 如果您的链接是用另一种语言生成的或由人工生成的,则需要查找适当的编码方式。 It all depends on what you want, really... 这完全取决于您想要什么,真的...

一种解决方案是查阅api的文档,并找出可以接受的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM