- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图了解 HTTP Builder 的简化 GET。我通过类似于 REST GET 请求的简单 GET 请求成功了。
def client = new HTTPBuilder('http://pokeapi.co')
def resp = client.get(path: '/api/v1/pokemon/1')
static void main(String[] args){
def h = new HTTP()
print h.resp.name
}
def client = new HTTPBuilder('http://svcs.sandbox.ebay.com')
def resp = client.get(path: '/services/search/FindingService/v1',
contentType: TEXT,
query:[
'SECURITY-APPNAME': APP_ID,
'OPERATION-NAME':'findItemsByKeywords',
'SERVICE_VERSION':'1.0.0',
'RESPONSE-DATA-FORMAT':'JSON',
'callback':'_cb_findItemsByKeywords',
'REST-PAYLOAD': '',
'keywords':'iphone 3g',
'paginationInput.entriesPerPage': '3'])
}
resp
,我得到:
java.io.StringReader@16d871c0
{"findItemsByKeywordsResponse":[{"ack":["Success"],"version":["1.13.0"],"timestamp":["2014-12-02T06:26:15.869Z"],"searchResult":[{"@count":"3","item":[{"itemId":["110089183401"],"title":["Apple iPhone 3G - 8GB - Black (Unlocked) Smartphone"],"globalId":["EBAY-US"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Cell Phones & Smartphones"]}],"galleryURL":["http:\/\/thumbs2.sandbox.ebaystatic.com\/m\/mI_iSJ1zmYlidmuoLh9Pndw\/140.jpg"],"viewItemURL":["http:\/\/cgi.sandbox.ebay.com\/Apple-iPhone-3G-8GB-Black-Unlocked-Smartphone-\/110089183401"],"productId":[{"@type":"ReferenceID","__value__":"100014203"}],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["95125"],"location":["San Jose,CA,USA"],"country":["US"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","__value__":"2.5"}],"shippingType":["Flat"],"shipToLocations":["US"],"expeditedShipping":["false"],"oneDayShippingAvailable":["false"],"handlingTime":["3"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","__value__":"100.0"}],"convertedCurrentPrice":[{"@currencyId":"USD","__value__":"100.0"}],"sellingState":["Active"],"timeLeft":["P25DT9H19M59S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2011-05-17T15:41:14.000Z"],"endTime":["2014-12-27T15:46:14.000Z"],"listingType":["FixedPrice"],"gift":["false"]}],"returnsAccepted":["true"],"condition":[{"conditionId":["1000"],"conditionDisplayName":["New"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]},{"itemId":["110116107959"],"title":["Apple iPhone 3G - 8GB - Black (AT&T) Smartphone (MB046LL\/A)"],"globalId":["EBAY-US"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Cell Phones & Smartphones"]}],"galleryURL":["http:\/\/thumbs4.sandbox.ebaystatic.com\/m\/mEcUS_FQToCpPxHhT12xHvw\/140.jpg"],"viewItemURL":["http:\/\/cgi.sandbox.ebay.com\/Apple-iPhone-3G-8GB-Black-AT-T-Smartphone-MB046LL-A-\/110116107959"],"productId":[{"@type":"ReferenceID","__value__":"101892398"}],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["98102"],"location":["Seattle,WA,USA"],"country":["US"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","__value__":"0.0"}],"shippingType":["Free"],"shipToLocations":["US"],"expeditedShipping":["false"],"oneDayShippingAvailable":["false"],"handlingTime":["1"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","__value__":"149.99"}],"convertedCurrentPrice":[{"@currencyId":"USD","__value__":"149.99"}],"sellingState":["Active"],"timeLeft":["P26DT22H10M10S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2013-05-08T04:31:25.000Z"],"endTime":["2014-12-29T04:36:25.000Z"],"listingType":["FixedPrice"],"gift":["false"]}],"returnsAccepted":["true"],"condition":[{"conditionId":["1000"],"conditionDisplayName":["New"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]},{"itemId":["110089171954"],"title":["Apple iPhone 3G - 8GB - Black (Unlocked) Smartphone"],"globalId":["EBAY-US"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Cell Phones & Smartphones"]}],"galleryURL":["http:\/\/thumbs3.sandbox.ebaystatic.com\/m\/m7btqoH-DYL3EWRCDJgThJg\/140.jpg"],"viewItemURL":["http:\/\/cgi.sandbox.ebay.com\/Apple-iPhone-3G-8GB-Black-Unlocked-Smartphone-\/110089171954"],"productId":[{"@type":"ReferenceID","__value__":"100014203"}],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["95125"],"location":["San Jose,CA,USA"],"country":["US"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","__value__":"2.5"}],"shippingType":["Flat"],"shipToLocations":["US"],"expeditedShipping":["false"],"oneDayShippingAvailable":["false"],"handlingTime":["3"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","__value__":"100.0"}],"convertedCurrentPrice":[{"@currencyId":"USD","__value__":"100.0"}],"sellingState":["Active"],"timeLeft":["P24DT9H2M20S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2011-05-16T15:23:35.000Z"],"endTime":["2014-12-26T15:28:35.000Z"],"listingType":["FixedPrice"],"gift":["false"]}],"returnsAccepted":["true"],"condition":[{"conditionId":["1000"],"conditionDisplayName":["New"]}],"isMultiVariationListing":["false"],"topRatedListing":["false"]}]}],"paginationOutput":[{"pageNumber":["1"],"entriesPerPage":["3"],"totalPages":["564"],"totalEntries":["1691"]}],"itemSearchURL":["http:\/\/shop.sandbox.ebay.com\/i.html?_nkw=iphone+3g&_ddo=1&_ipg=3&_pgn=1"]}]}
最佳答案
修复。 contentType 不是 TEXT
.
关于groovy - HTTPBuilder 查询参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27243237/
我有一些库脚本:lib1.groovy: def a(){ } lib2.groovy: def b(){ } lib3.groovy: def c(){ } 并想在其他脚本中使用它们:配置文件: a
我有下面的 Groovy 脚本,我需要将它放在集中式 Groovy 库中,然后从 Ready API 项目中的任何脚本访问 Groovy 中提到的类 路径 : D:\GroovyLib\com\Lin
看完后this link ,我想尝试Groovy++,但我有一个担心; Groovy 的所有语法在 Groovy++ 中都有效吗? 例如,我可以在 Groovy 中执行此操作: def list =
我在 Spring-boot 应用程序中混合了 Groovy 和 Java。休息 Controller 和数据访问是用 Groovy 编写的。配置主要使用Java。 根据 logback 文档,如果类
我已阅读how to simply import a groovy file in another groovy script 我想在一个 groovy 文件中定义常用函数,并从其他 groovy 文
你知道,我也知道,只要只有一个是公共(public)的,就可以用 Java 实现。但是,在 Groovy 中可以这样做吗?如果是的话,在什么条件下? 最佳答案 Java 和 Groovy 之间在可以放
~/groovy % tree . ├── lib │ ├── GTemplate.class │ └── GTemplate.groovy └── Simple.groovy class
给定一个具有属性和构造函数的对象,我希望将构造函数参数复制到属性中,然后在构造函数中做一些额外的工作。 import groovy.transform.TupleConstructor @TupleC
我会提前道歉,我是 groovy 的新手。我的问题是我有 3 个执行不同功能的 groovy 脚本,我需要从我的主 groovy 脚本中调用它们,使用脚本 1 的输出作为脚本 2 的输入和脚本 2 的
我想在静态闭包中存储一些属性,然后在方法调用期间访问它们: class Person { static someMap = { key1: "value1", key2: "value2" } }
Groovy 是否有安全范围运算符? 例如,如果我有, [1,2,3][0..10] Groovy 会抛出一个 java.lang.IndexOutOfBoundsException: 有没有索引安全
在 Groovy 中使用 Maps/JsonBuilder 处理一些翻译/映射功能。 是否有可能(无需在 map 文字创建之外创建额外的代码).. 有条件地包含/排除某些键/值对?一些事情沿着以下路线
不知道我是否正确询问,但是我有类似以下内容: def x = 1 if (x == 1) { def answer = "yes" } println answer 我收到错误
我不明白 groovy 打字是如何工作的。在 wikipedia据说它具有很强的类型,但我可以在解释器上完美地做到这一点: 1 + '1' ==> 11 所以也许我很困惑,我不明白弱类型是什么,但我想
我对函数式编程概念非常陌生,正在观看 Neil Ford 在 youtube 中的演讲。 .在那里他谈到了一个计数器来演示一段代码而不使用全局状态(在 20:04)。来自 Java 世界,我很难理解这
我有两个问题。 我执行以下代码来查找 $ 的 ASCII 值: def a = "\$" def b = (int)a println b //prints 36 好吧,我对答案很满意。但是当我尝试像
只是想知道 时髦 像这样与默认值进行值匹配的方法? if(params.max != 10 && params.max != 20 && params.max != 30){ params.m
我最近正在读《行动中的格鲁夫》。在第7章中,它介绍了*。运算符(operator) 。当我运行有关此运算符的代码时,我会遇到一些错误。 class Invoice {
是否有易于阅读的方法或一些聪明的方法来制作 combination Groovy 中的元素?我知道 Iterable#combinations或 GroovyCollections#combinati
最近我下载了 Groovy-2.3.6 并尝试在 Linux 系统上安装它。我按照 http://groovy-lang.org/install.html 的说明进行操作.我设置了我的 GROOVY_
我是一名优秀的程序员,十分优秀!