[英]Strange “new” property appearing after REST call using HTTPBuilder and Grails
我有一個grails控制器使用HTTPBuilder對Spring后端進行REST調用:
def getSettings(String customerID) {
def http = new HTTPBuilder( grailsApplication.config.com.company.product.productWebserviceURL )
def result = [:]
def postBody = [customerID: customerID]
try {
http.post(path: 'product/getSettings', body: postBody, requestContentType: URLENC) { resp, json ->
result = json
}
} catch (IOException ex) {
logger.error("Cannot in attempting to get settings via webservice for customerID: " + customerID + ". Is the server running? \nError: " + ex.getMessage())
result['errors'] = [[message : this.CUSTOMER_FACING_TRANSACTIONHISTORY_DOWN_MESSAGE]]
response.status = 500;
}
render result as JSON
}
一切都很好,除了獲得JSON響應之外,還有一個名為“new”的新屬性。 以下是我的Spring后端將作為JSON返回的Settings對象:
這里它是grails控制器中的JSON響應。 注意不屬於原始Settings對象的額外第五個屬性:
有誰知道這個名為“新”的神秘財產如何不斷加入?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.