需要带有file

编程入门 行业动态 更新时间:2024-10-16 20:24:33
本文介绍了需要带有file_get_contents(PHP)的HTTP 500响应主体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用file_get_contents作为自定义SOAP实现的一部分来应用SOAP调用(我们尝试的所有库都无法正确地使用SOAP 1.2进行基于SSL +证书的身份验证).但是,困难且几乎没有文档记录的API通常返回500.响应正文中有错误详细信息,但file_get_contents似乎不允许访问它. fopen似乎有同样的问题.

Using file_get_contents as part of custom SOAP implementation to apply SOAP calls (ALL libraries that we tried would not do SSL + certificate based authentication with SOAP 1.2 correctly). However difficult and barely-documented API often returns 500. There are error details in response body, but file_get_contents doesn't appear to allow access to it. fopen seems to have the same issue.

怎么办?

由于大量使用流上下文来使身份验证正常工作,因此最好不要使用cURL.

Prefer not to go to cURL due to heavy use of stream contexts to get authentication working.

推荐答案

您可以考虑 nusoap .

但是对于您的问题,如果您使用ignore_errors,它就可以解决问题.

For your question though, it works if you use ignore_errors.

$context = stream_context_create(array( 'http' => array( 'ignore_errors' => true ) )); $contents = file_get_contents($url, false, $context);

更多推荐

需要带有file

本文发布于:2023-11-12 10:37:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581251.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:file

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!