草庐IT

application-client

全部标签

php - fatal error :使用 Guzzle 6 调用未定义的方法 GuzzleHttp\Client::request()

我在Laravel5.2中使用Guzzle6。我正在尝试访问一个简单的内部API:useGuzzleHttp\Client;$client=newClient(['base_uri'=>getenv('URL_BASE').'api/v1/']);$response=$client->request('GET','tournaments');我收到这条消息:Fatalerror:CalltoundefinedmethodGuzzleHttp\Client::request()当我看到docs,它说:$client=newGuzzleHttp\Client(['base_uri'=>'h

php - Laravel Socialite - 谷歌登录失败 "Missing required parameter: client_id"虽然指定

我在使用LaravelSocialite通过GoogleAPI登录用户时遇到了这个奇怪的问题。所有的配置看起来都很正常,但是我一直报错Missingrequiredparameter:client_id。不仅如此,有时我再次尝试时,错误变成了Missingrequiredparameter:redirect_uri尽管已经提供了所有这些参数。这是它的设置方式:service.php'google'=>['client_id'=>'xxxxxxxxxx-x98asxxxx913ofk5tqvgq7lqfpgdi5u2.apps.googleusercontent.com','client

php - 亚马逊 mws api 类 'MarketplaceWebService_Client' 未找到错误

下载解压后的亚马逊MWSclientlibraryapi我已经尝试运行其中一个脚本以查看是否一切正常。尝试运行文件GetReportCountSample.php时出现错误Fatalerror:Class'MarketplaceWebService_Client'notfoundinC:\xampp\htdocs\sites\amazonmarketplace\Samples\GetReportCountSample.phponline68我查看了配置文件并输入了我的凭据,例如:define('AWS_ACCESS_KEY_ID','');//hasbeeninputdefine('A

php - google-api-php-client:无效的客户端 secret JSON 文件

似乎最新版本的google-api-php-clientforPHP与文档不一致@https://developers.google.com/drive/web/examples/php查看src代码,我发现它在下载的JSON中寻找setAuthConfigFile()方法找不到的键:client_secret、installed、web、redirect_uris(其他?)在下载的JSON中不存在.只有private_key_id、private_key、c​​lient_email、client_id和type存在。代码和文档看起来确实杂乱无章且不同步……这对Google来说不是第

javascript - 文件获取内容 ('php://input' );使用 application/x-www-form-urlencoded;

我在这里阅读了一些关于该主题的问题,但找不到我正在寻找的答案。我正在用jQuery将一些$.post发送到PHP5.6服务器。$.post('/',{a:100,b:'test'},function(data){},'json');控制台的编码是Content-Typeapplication/x-www-form-urlencoded;charset=UTF-8如果我尝试使用常规$_POST读取POST数据,PHP5.6会提醒我PHPDeprecated:Automaticallypopulating$HTTP_RAW_POST_DATAisdeprecatedandwillberem

php - Facebook OAuthException : "user hasn' t authorized the application to perform this action"

使用FacebookPHPSDK,当我尝试发布状态更新时出现以下错误:Fatalerror:UncaughtOAuthException:(#200)Theuserhasn'tauthorizedtheapplicationtoperformthisaction这些是我采取的步骤:获取代码:https://graph.facebook.com/oauth/authorize?client_id=FB_APP_ID&redirect_uri=REDIRECT_URI获取访问token:https://graph.facebook.com/oauth/access_token?client

php - Symfony 4,Postgres - `Invalid value for parameter "client_encoding": "utf8mb4"` on running doctrine command

问题我对postgres10.5和symfony4应用程序进行了全新设置,在php7.1上运行。但是当我尝试运行迁移时。我不断收到以下Invalidvalueforparameter"client_encoding":"utf8mb4"错误。重现步骤在.env文件上,根据您的设置修改DSN以更正值,例如。我的是DATABASE_URL="pgsql://postgres:password@db:5432/a_db"。使用phpbin/consolemake:entity创建一个实体(任何人都可以)制作迁移文件phpbin/consolemake:migration预期结果我应该收到成功

php - XAMPP Apache 错误 : client denied by server configuration

我刚启动计算机,XAMPP中的Apache不再工作。我怀疑这与我今天早些时候第一次访问我parent网站的服务器有关。错误日志给出了这条信息:[SunAug0409:15:35.8897002013][authz_core:error][pid5088:tid1776][client::1:58124]AH01630:clientdeniedbyserverconfiguration:C:/Users/James/Desktop/Container/XAMPP/apache/icons/folder.gif,referer:http://localhost/Triiline1/我根据以

php - 找不到类 'GuzzleHttp\Client'

我同时使用Guzzle和Codeigniter3.0首次亮相。我也承认我是第一次使用php命名空间。我正在尝试根据文档中提供的示例使用Guzzle发出一个非常简单的获取请求。(Guzzle文档对codeigniter只字不提)。Guzzle文件位于application/class/guzzle这是我非常简单的Controllerpublicfunctionindey(){$data=array();$data['main_content']="hiview";$data['title']="DataAnalyzer-Welcome";$data['xas']=$this->guzzl

php - curl -X POST -H 'Content-Type: application/json' -d 到 PHP

我需要发出curl请求,我有这一行“curl-XPOST-H'Content-Type:application/json'-d”并且需要“翻译”为PHPcurl。问题是我不知道“-X”、“-H”和“-d”是什么意思。curl_setopt($ch,CURLOPT_HTTPHEADER,array('Accept:application/json','Content-Type:application/json','Content-Length:'.strlen($itemJson)));我在标题上尝试了类似的东西($itemJson是一个JSON字符串)但是我得到了错误400。我认为我以