How to consume text/plain response with Restlet 2.1 from GWT client?
-
15-04-2021 - |
質問
I have a GWT client that would like to query a RESTful service that returns text/plain
. I created a proxy interface:
public interface ConnectionStatusService extends ClientProxy
{
@Get("txt")
public void getVersion(Result<String> callback);
}
But when I'm using the generated proxy class:
ConnectionStatusService service = GWT.create(ConnectionStatusService.class);
it sends a request that accepts Accept application/x-java-serialized-object+gwt
according to Firebug, so the server returns HTTP 406 Not Acceptable of course.. :-( How could I make it accept plain text?
解決
I'm using resty-gwt to create restfull web services but I'm not accessing it now from GWT client classes. They have documentation where it's documented.
Hope that helps.
所属していません StackOverflow