httpbuilder

    0熱度

    2回答

    我有下面的代碼在Groovy: def http = new HTTPBuilder('http://localhost:8080') http.post(path: '/this/is/my/path/'+variable) { resp -> println "POST Success: ${resp.statusLine}" assert resp.statusLine

    0熱度

    2回答

    我試圖訪問某個json從api調用返回到地圖中的元素,因此我可以將它傳遞給另一個api調用。我似乎無法正確創建一個變量,並給它我需要的值。這裏是返回的json,我需要訪問Id元素。 { "totalSize": 1, "done": true, "records": [ { "attributes": { "type":

    2熱度

    1回答

    我有一個常規文件下面的代碼: @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7') 我試圖下載依賴使用HTTPBuilder .. 但它顯示我的錯誤作爲如下: Error grabbing Grapes -- [download failed: org.apac

    0熱度

    1回答

    我得到這個錯誤,但我的方法看起來完全沒有給我 def http = new HTTPBuilder() http.request( 'https://textalytics-topics-extraction-11.p.mashape.com/topics-1.2?txt=ben', Method.GET, ContentType.JSON ) { req ->

    31熱度

    7回答

    我聽說Groovy有一個內置的REST/HTTP客戶端。我能找到的唯一的圖書館是HttpBuilder,是這樣嗎? 基本上我正在尋找一種方法來從Groovy代碼中執行HTTP GET,而無需導入任何庫(如果可能的話)。但是由於這個模塊似乎並不是Groovy核心的一部分,我不確定這裏是否有正確的lib。

    1熱度

    1回答

    我需要編寫一個Web客戶端,它可以訪問舊版網絡應用,登錄到該網頁,從/widget頁面提取一些信息,並根據此頁面的HTML做一些工作。我選擇使用Groovy/HttpBuilder解決方案,原因不在此問題範圍之內。 唯一的缺點(從我可以告訴的是)HttpBuilder不支持在請求之間保留cookie。這是一個重大的問題,因爲(Java)的Web應用程序使用JSESSIONID cookie來確定用

    1熱度

    1回答

    我得到了很多這些警告消息對REST客戶端調用,不需要Cookie: [http-bio-8080-exec-10] WARN protocol.ResponseProcessCookies - Cookie rejected: "[version: 1][name: mzf_in][value: 990108][domain: .xxxx.com][path: /asdf][expiry: nul

    0熱度

    2回答

    我有以下代碼。我想要的代碼來獲取所有數據,從當前URL這就好比 search.php?q=dvd+player&attr=23903940_portable_dvd_player&attr=23903945_cd&attr=23903935_mpeg_4 代碼: <?php if ($pagecount > 1) { $paramsP1 = array_merge($_G

    1熱度

    2回答

    我想使用下面的代碼發送請求到sendgrid添加電子郵件列表,但我總是得到404:錯誤的請求。 def chttps = new HTTPBuilder('https://api.sendgrid.com/api/newsletter/lists/email/add.json?&api_user=myUser&api_key=myKey') chttps.request(Method.

    1熱度

    1回答

    我正在嘗試上傳文件到使用HttpBuilder通過SSL運行的Web服務。我是從Gradle構建文件中完成的,但我不相信這真的很重要。該Web服務是Grails應用程序的一部分,但同樣不要以爲重要。 當您告訴它通過https運行時,我的grails應用程序使用由grails生成的證書在本地運行SSL。我的代碼,本地工作如下: def http = new groovyx.net.http.HTTP