java - How to send parameters in a GET call with restlet? -


confirmed following in curl:

this working fine-

curl -x 'http://remoteurl.com:8080/public/private/request/data?begin=12&end=20' 

this not working-

curl -x http://remoteurl.com:8080/public/private/request/data?begin=12&end=20 

so whole purpose use way first curl command in java code restlet send paramters in request unfortunately code not working.

code:

    clientresource clientresource = new          clientresource("http://remoteurl.com:8080/public/private/request/     data?begin=12&end=20");     representation clienttext = clientresource.get(); 

error log:

info: unable read header java.io.ioexception: parameter or extension has no name. please check value     @ org.restlet.engine.header.headerreader.readnamedvalue(headerreader.java:499)     @ org.restlet.engine.header.cachedirectivereader.readvalue(cachedirectivereader.java:65)     @ org.restlet.engine.header.cachedirectivereader.readvalue(cachedirectivereader.java:38)     @ org.restlet.engine.header.headerreader.addvalues(headerreader.java:282)     @ org.restlet.engine.header.cachedirectivereader.addvalues(cachedirectivereader.java:50)     @ org.restlet.engine.header.headerutils.copyresponsetransportheaders(headerutils.java:776)     @ org.restlet.engine.adapter.clientadapter.readresponseheaders(clientadapter.java:129)     @ org.restlet.engine.adapter.clientadapter.updateresponse(clientadapter.java:191)     @ org.restlet.engine.adapter.clientadapter.commit(clientadapter.java:105)     @ org.restlet.engine.adapter.httpclienthelper.handle(httpclienthelper.java:119)     @ org.restlet.client.handle(client.java:153) 

from exception give in question, seems value of header cache-control isn't correct within response. restlet isn't able parse it.

i guess value of header empty string in response...

could give in question exact content of response (mainly headers)?

hope helps you, thierry


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -