Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
url with a space giving problem
Joined: Jan 13, 2008
Feb 19, 2012 21:05:46
I am constructing an url like below and trying to get the JSON objects.
String url = "http://test.ntu.edu.sh/libs/sample" + " " + "name/list/json"; SimpleClient c = new SimpleClient(); c.setWsUsername("test"); c.setWsPassword("test"); c.setElmServiceUrl(url);
I get the following error.
Error retrieving library list
: Invalid uri
: escaped absolute path not valid
If I paste the above URI on an browser, it goes through and I get the JSON object.
How to introduce a white space between
"sample" + " " + "name"
as the above construction doesn't pass.
Many Thanks in advance.
Joined: May 03, 2008
Feb 20, 2012 00:34:54
edit Which you could have discovered by reading the API for
. You would also have discovered an alternative approach.
There are no new questions, but there may be new answers.
Joined: Oct 27, 2005
Feb 20, 2012 03:59:52
+ is also an option for spaces.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
rocket mass heater
subject: url with a space giving problem
Automatic Installation of 100+ Open Source Projects for Java Developers
Java EE 5 Tutorial - Problem with Web Services
Struts2-json plugin not serializing action class to json
REST vs SOAP - stateful/stateless
Getting message as Invalid JSON
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013