使用POST方法 [英] using POST method

查看:229
本文介绍了使用POST方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用Bing Translate和GET(curl)方法,一切正常。


但现在我需要使用POST方法,添加新行:

 $ postData = array('text'=>'home','to'=>'it','from '=>'en'); curl_setopt($ ch,CURLOPT_POST,TRUE); curl_setopt($ ch,CURLOPT_POSTFIELDS,$ postData); 


现在得到错误:


" ;错误状态代码:'InternalServerError'



详细信息:服务器在处理请求时遇到错误。有关详细信息,请参阅服务器日志。"
$


BING不支持POST?

解决方案

HTTP服务的'translate'方法仅限GET。


如果你想使用POST,GetTranslations(http:/ /msdn.microsoft.com/en-us/library/ff512417)方法可用。


这里的完整文档:


http:// msdn .microsoft.com / EN-US /库/ ff512419.aspx


Hi,

I using Bing Translate with GET (curl) method and everything work fine.

But now i need using POST mothod, add new line:

$postData = array('text'=>'home', 'to'=>'it', 'from'=>'en');curl_setopt($ch, CURLOPT_POST, TRUE);	curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);

And now get error:

"Error Status Code: 'InternalServerError'

Details: The server encountered an error processing the request. Please see the server logs for more details."

BING does not support POST?

解决方案

The 'translate' method of the HTTP service is GET only.

If you want to use POST, the GetTranslations (http://msdn.microsoft.com/en-us/library/ff512417) method is available.

Full docs here:

http://msdn.microsoft.com/en-us/library/ff512419.aspx


这篇关于使用POST方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆