Hi Alexander,

I gave it a go, but now running into status 401 ( not authorized )

text : {"errors":{"nonauthorizedrequest":"Non-Authorized 
Request"},"status":"failed"}
status: 401

That is an improved, communication with the backend server is working now, I 
guess.

How do I debug a gadget into this detail ?
I picked up a client side Base64 encoding algo from the web, since GWT does 
not seem to have one. 

Got any good advice for me how to debug from here ?


RootPanel rootPanel = RootPanel.get();
rootPanel.add(new Label("Test categories"));
GadgetsIo io = IoProvider.get();
ResponseReceivedHandler<JavaScriptObject> handler = new 
ResponseReceivedHandler<JavaScriptObject>() {
@Override
public void onResponseReceived(
ResponseReceivedEvent<JavaScriptObject> event) {
Response<JavaScriptObject> response = event.getResponse();
String text = response.getText();
int status = response.getStatusCode();
Window.alert("text : " + text);
Window.alert("status: " + status);
}
};
RequestOptions options = RequestOptions.newInstance();
options.setHeader("Accept", "application/json");
options.setMethodType(MethodType.GET);
options.setHeader("Authorization", 
Base64.encode("[email protected]:secret"));
String url = "https://secure.service.com/contacts/categories";;
io.makeRequestAsJso(url, handler, options);




-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en.

Reply via email to