索引中查询中的非法字符

时间:2015-03-16 08:46:14

标签: java url get jackson

我尝试发送http GET请求, 但是我得到了一个错误。

如何轻松追踪哪个角色为at index 2681

此网址中的错误是什么?

java.lang.IllegalArgumentException: Illegal character in query at index 2681: https://www.waze.com/il-RoutingManager/routingRequest?returnJSON=true&to=s%3A-1+d%3Afalse+f%3A-1.0+x%3A34.880035+y%3A32.195827+r%3A-1.0+cd%3A-1.0+fn%3A-1+tn%3A-1+bd%3Atrue&returnGeometries=true&nPaths=3&paths=[(223359,344653,34.83629,32.247553),(311522,35193,34.832987,32.233661),(61207,264229,34.83333404318432,32.23290879457607),(867094,46849,34.832996,32.232),(948473,9978,34.83207305677538,32.227359203507525),(147624,450783,34.83551865755623,32.226758215567415),(344186,114873,34.840355,32.22636),(11851,302146,34.844453,32.22509999999999),(906083,616876,34.84588759844429,32.224657914696074),(165139,128518,34.84778816931152,32.228796626983645),(906056,128516,34.848532,32.231217999999984),(906075,616871,34.85144387847067,32.23787389973255),(906073,616870,34.85857296319217,32.23867938551671),(821762,388935,34.86273909004792,32.239464490708855),(821761,549870,34.867943078351786,32.24009950237056),(513981,302163,34.870401,32.23981),(633745,247015,34.871210734466985,32.23964765421188),(250335,448351,34.87224997749702,32.23939337339363),(516426,616855,34.87470389341226,32.23871534015601),(141298,142497,34.87577126161273,32.238334553030334),(115599,90375,34.878729953372954,32.23748813128281),(115598,90377,34.878822,32.237325),(141304,90376,34.87900529484775,32.23746825108575),(127092,11004,34.88471652204349,32.23545369217262),(214609,170386,34.88463459860798,32.233172847035746),(242762,196050,34.88319958497327,32.218893796929194),(333783,294280,34.883704467379154,32.21022043731985),(233579,104079,34.88372031582784,32.209818593122314),(310718,268037,34.88462192182586,32.19945893950955),(313736,451516,34.88637339615631,32.19506075728607),(373594,249678,34.889829,32.191131),(302171,311477,34.890433,32.191165),(728951,249684,34.89261698280335,32.19107036441803),(716388,499444,34.892829986965,32.19102363246496),(1025571,713310,34.89161810072556,32.19036981319844),(992773,713308,34.89142688200331,32.19067877036893),(992774,679706,34.89103747149231,32.19161565233032),(895612,608632,34.8908321064348,32.19206476723727),(992762,608630,34.89086237297713,32.192184284055614),(992763,679699,34.892113618385316,32.19241991534423),(993544,608626,34.89225680330062,32.192354661354216),(993545,680210,34.89227824673388,32.1922264045502),(895608,608627,34.89235011982441,32.192196432121875),(747709,608628,34.89247911299611,32.19225531594978),(747708,508592,34.89258740577915,32.192199404917076),(101843,395716,34.89295292321816,32.19156464660181),(728950,24161,34.89301190674591,32.19098372023773),(728951,499444,34.892829986965,32.191023632465),(302171,249684,34.89261698280335,32.19107036441803),(373594,311477,34.890433,32.191165),(302163,249678,34.889829,32.191131)]|[(223359,344653,34.83629,32.247553),(311522,35193,34.832987,32.233661),(61207,264229,34.83333404318432,32.23290879457607),(867094,46849,34.832996,32.232),(948473,9978,34.83207305677538,32.227359203507525),(147624,450783,34.83551865755623,32.226758215567415),(344186,114873,34.840355,32.22636),(11851,302146,34.844453,32.22509999999999),(906083,616876,34.84588759844429,32.224657914696074),(165139,128518,34.84778816931152,32.228796626983645),(906056,128516,34.848532,32.231217999999984),(906075,616871,34.85144387847067,32.23787389973255),(906073,616870,34.85857296319217,32.23867938551671),(821762,388935,34.86273909004792,32.239464490708855),(821761,549870,34.867943078351786,32.24009950237056),(513981,302163,34.870401,32.23981),(633745,247015,34.871210734466985,32.23964765421188),(250335,448351,34.87224997749702,32.23939337339363),(516426,616855,34.87470389341226,32.23871534015601),(141298,142497,34.87577126161273,32.238334553030334),(115599,90375,34.878729953372954,32.23748813128281),(115598,90377,34.878822,32.237325),(141304,90376,34.87900529484775,32.23746825108575),(127092,11004,34.88471652204349,32.23545369217262),(214609,170386,34.88463459860798,32.233172847035746),(242762,196050,34.88319958497327,32.218893796929194),(333783,294280,34.883704467379154,32.21022043731985),(233579,104079,34.88372031582784,32.209818593122314)]&returnClientIds=true&returnInstructions=true&hour=08+03&from=s%3A-1+d%3Afalse+f%3A-1.0+x%3A34.838921+y%3A32.246044+r%3A-1.0+cd%3A-1.0+fn%3A489075+tn%3A489074+bd%3Afalse&sameResultType=true&type=HISTORIC_TIME&clientVersion=3.9.3.0&options=PREFER_UNKNOWN_DIRECTIONS%3Afalse%2CALLOW_UNKNOWN_DIRECTIONS%3Afalse%2CIGNORE_REALTIME_INFO%3Afalse%2CAVOID_LONG_TRAILS%3Afalse%2CUSE_EXTENDED_INSTRUCTIONS%3Atrue%2CAVOID_TRAILS%3Atrue%2CALLOW_UTURNS%3Atrue%2CAVOID_DANGER_ZONES%3Atrue%2CAVOID_PRIMARIES%3Afalse%2CAVOID_TOLL_ROADS%3Afalse%2CPREFER_SAME_STREET%3Afalse
    at java.net.URI.create(URI.java:852)
    at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
    at com.waze.routing.automation.net.RoutingUrlHttpClient.sendRoutingRequestString(RoutingUrlHttpClient.java:51)

1 个答案:

答案 0 :(得分:0)

使用邮件中的URL创建一个文件,并使用命令行中的cut选择要查看的字符。

请注意,索引是从0开始的,但剪切字段编号是从1开始的。因此,从cut的角度来看,我们正在寻找角色2682.所以在这种情况下,命令将是

$ cut -c 2673-2692 url.txt
.191131)]|[(223359,3

第10个字符,即错误消息中抱怨的那个字符是|