guzzle

    4熱度

    1回答

    我試圖從Goutte訪問Guzzle Response對象。因爲那個對象有我想要使用的很好的方法。例如getEffectiveUrl。 就我所見,沒有黑客入侵代碼是沒有辦法的。 或者沒有訪問響應對象,有沒有辦法得到最後一個重定向的url foum goutte?

    0熱度

    1回答

    我一直在使用Guzzle models,並取得了一些成功。響應數據是非序列化的,我可以使用其他值而不是原始JSON響應來擴充數據。 然而,我所有的型號都缺少自己的驗證結構。當我返回意外的鍵或錯誤類型的值時,我不會收到任何驗證錯誤。要麼我做錯了什麼,要麼我誤解了應該發生的事情。 下面是一個測試案例的形式,我的示例代碼: https://gist.github.com/timwhitlock/8511

    2熱度

    1回答

    我最近使用了Guzzle來刮取URL,並且這在沒有錯誤時工作正常。 然而,如果有,例如404,假設 $response = $client->get('http://www.google.com/test')->send(); 手冊(Response Status Line)提出,然後上面的代碼會允許我這樣稱呼 $response->isSuccessful(); 但send()拋出一個C

    0熱度

    1回答

    <?php require_once '/var/www/goutte.phar'; use Goutte\Client; $guzzle = parent::getClient(); //You'll want to pull the Guzzle client out of Goutte to inherit its defaults $guzzle->setDefaultOpti

    0熱度

    1回答

    我有一個web服務應該爲我的網站提供圖像。 問題是圖像受到「標記」請求標題的保護。 我使用guzzle作爲客戶端庫調用webservice並獲取圖像。 $client = new \Guzzle\Service\Client(); $req = $client->get('https://www.customwebservice.be/v1/api/photo/ece1d868.jpg');

    1熱度

    1回答

    我正在使用服務描述創建一個Guzzle客戶端。服務描述中的每個操作都包含一個URI。我正在訪問的REST端點需要一個授權標頭,它通過將公鑰和端點的uri粘在一起,然後從結果字符串中創建一個md5。這用作授權值。 我不知道如何在實例化客戶端後從服務描述中獲取uri值。 我創建了狂飲客戶是這樣的: class RestClient extends Client { public stati

    3熱度

    5回答

    A.摘要 正如其標題,狂飲允許一次發送多個請求,以節省時間爲documentation。 $responses = $client->send(array( $requestObj1, $requestObj2, ... )); (given that each request object is an instance of Guzzle\Http\Messa

    0熱度

    1回答

    我想在Guzzle中定製序列化。 我設置一個POSTapplication/json請求,但我的目標是在開始連載其名稱(professionalSession),即: { professionalSession : { param1 : "asdf", param2 : "jkl;", ... } } 即與REST API我試圖打電話不一致

    2熱度

    1回答

    如何通過guzzle服務客戶端getCommand函數獲取發佈數據? 我的JSON如下所示: "createMessage": { "httpMethod": "POST", "uri": "conversations/{conversation_id}/message", "summary": "conversations by user", "r

    49熱度

    3回答

    當服務器返回4xx和5xx狀態碼時,我想處理Guzzle中的錯誤。我提出一個要求是這樣的: $client = $this->getGuzzleClient(); $request = $client->post($url, $headers, $value); try { $response = $request->send(); return $response->ge