脚本宝典收集整理的这篇文章主要介绍了php – Google Closure编译器和multipart / form-data无法正常工作,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$content = file_get_contents('file.js'); $url = 'http://closure-compiler.appspot.COM/compile'; $post = true; $postData = array('output_info' => 'compiled_code','output_format' => 'text','compilation_level' => 'SIMPLE_OPTIMIZATIONS','js_code' => urlencode($content))); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_HEADER,1); curl_setopt($ch,CURLOPT_RETURNtransfer,1); if ($post) { curl_setopt($ch,CURLOPT_POST,$post); curl_setopt($ch,CURLOPT_POSTFIELDS,$postData); } curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-tyPE: application/x-www-form-urlencoded; charset=UTF-8'));
Error(18): UnkNown parameter in Http request: '------------------------------0F1f2f05fb97 Content-DisposITion: form-data; name'. Error(13): No output information to PRoduce,yet compilation was requested.
我查看了标题,并发送了此Content-Type标头:
application/x-www-form-urlencoded; charset=UTF-8; boundary=----------------------------0f1f2f05fb97
不确定添加的边界是否正常?我如何防止这种情况,谷歌似乎不喜欢它?
谢谢,
韦斯利
以上是脚本宝典为你收集整理的php – Google Closure编译器和multipart / form-data无法正常工作全部内容,希望文章能够帮你解决php – Google Closure编译器和multipart / form-data无法正常工作所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。