我正在嘗試創建一個針對Strava API的GWT應用程序。 首先要做的是驗證。OAuth with GWT against Strava API
在http://strava.github.io/api/v3/oauth/他們說,你必須做一些事情,如代幣兌換:
curl -X POST https://www.strava.com/oauth/token \
-F client_id=5 \
-F client_secret=7b2946535949ae70f015d696d8ac602830ece412 \
-F code=75e251e3ff8fff
據我知道這些事情-F代表的多種形式的後場? 因此,我創建類似:
final FormPanel form = new FormPanel();
container.add(form);
form.setAction("https://www.strava.com/oauth/token");
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
VerticalPanel panel = new VerticalPanel();
form.setWidget(panel);
panel.add(new Hidden("client_id", CLIENT_ID));
panel.add(new Hidden("client_secret", CLIENT_SECRET));
panel.add(new Hidden("code", code));
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler()
{
@Override
public void onSubmitComplete(SubmitCompleteEvent event)
{
GWT.log("complete " + event.getResults());
}
});
container.addAttachHandler(new AttachEvent.Handler()
{
@Override
public void onAttachOrDetach(AttachEvent event)
{
form.submit();
}
});
現在我做到這一點我看在Chrome開發工具以下錯誤時:
Refused to display 'https://www.strava.com/oauth/token' in a frame because it set 'X-Frame-Options' to 'deny'.
FormPanelImpl.java:117 POST https://www.strava.com/oauth/token net::ERR_BLOCKED_BY_RESPONSE
現在的問題是。我是否通過創建一個模擬該捲曲示例的表單來糾正? 這個幀錯誤與GWT使用IFRAME的東西有關嗎?我該如何解決 ?