I'm finding a strange situation where an HTTP GET gets changed to
OPTIONS, and I receive nothing from my GET. I'm working on an
application where I'll be working with various CRUD operations via
REST calls to my local server. Right now I'm just writing the GET and
finding that my response has no data and a status of 0. I learn from
the log that the GET has been changed to HTTP OPTIONS. Any clue why,
and what I can do to fix it? I think what I need to do is a common
and straightforward thing; surely other people have run into this?
This is my code:
public class RESTClient
{
public static void doGET(String strLoginName, String strLoginPassword,
String strURL, RequestCallback callback) throws RequestException
{
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
URL.encode(strURL));
// Authorization:auth-type="mii-basic",login-name="root",login-
password="root"
builder.setHeader("Authorization", auth-type=\"mii-basic\",login-
name=\"" + strLoginName +"\",login-password=\""+strLoginPassword +
"\"");
builder.setTimeoutMillis(2000);
builder.sendRequest(null, callback);
}
}
It's invoked from my main class thus:
private final String m_kstrJSONAcctURL = "
http://127.0.0.1:8080/v1/
authsrvc/accounts/myAccount.json";
...
RESTClient.doGET("root", "root", m_kstrJSONAcctURL, new
RequestCallback()
{
public void onError(Request request, Throwable exception)
{
...
// We never get here
}
public void onResponseReceived(Request request, Response
response)
{
// Here we find our response
status is 0
}
});
So note that we're running with two different ports. The REST service
uses Jetty and is on port 8080, while my caller uses the debugger's
Apache and is on port 8888. Any ideas?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
google-we...@googlegroups.com.
To unsubscribe from this group, send email to
google-web-tool...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.