我正在嘗試對 uri 進行 GET 回應,但每次我收到的都是錯誤訊息“無效的 uri”這是我嘗試過的(代碼片段):
String sAttachURL = "https://rt4.de.company.com/gx/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Electric_TM/executionworkitem?fields=feed/entry/content/executionworkitem/testplan[@href=\"rt4.de.company.com/gx/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Electric_TM/testplan/urn:com.ibm.rqm:testplan:27\"]";
GetMethod method = new GetMethod(sAttachURL);
在這里,如果我在 RESTClient 中點擊相同的 url,如果嘗試觸發這樣的事情,回應也會正確出現:
String sAttachURLService = "https://rt4.de.company.com/gx/service";
GetMethod method = new GetMethod(sAttachURLService);
回應通過我的代碼正確出現,但僅對于sAttachURL其拋出錯誤不知道為什么我也覺得這里的 [] 括號可能會導致一些問題,而編碼不確定 任何人都可以在這里幫助我
謝謝
uj5u.com熱心網友回復:
您是否嘗試過對括號進行百分比編碼?[ 代表 [ ] 代表 ],所以在你的情況下:
String sAttachURL = "https://rt4.de.company.com/gx/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Electric_TM/executionworkitem?fields=feed/entry/content/executionworkitem/testplan[@href=\"rt4.de.company.com/gx/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Electric_TM/testplan/urn:com.ibm.rqm:testplan:27\"]";
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/387582.html
