当前位置: 首页>>代码示例>>Java>>正文


Java Verb.POST属性代码示例

本文整理汇总了Java中com.github.scribejava.core.model.Verb.POST属性的典型用法代码示例。如果您正苦于以下问题:Java Verb.POST属性的具体用法?Java Verb.POST怎么用?Java Verb.POST使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.github.scribejava.core.model.Verb的用法示例。


在下文中一共展示了Verb.POST属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

protected OptionOrder doInBackground(Void... voids){
    OptionOrder order = new OptionOrder();

    //Build the OAuth service
    final OAuth10aService service = new ServiceBuilder()
            .apiKey(apiKeys.CONSUMER_KEY)
            .apiSecret(apiKeys.CONSUMER_SECRET)
            .build(TradeKingApi.instance());
    Token accessToken = new Token(apiKeys.OAUTH_TOKEN, apiKeys.OAUTH_TOKEN_SECRET);

    // Fetch the JSON data
    OAuthRequest request = new OAuthRequest(Verb.POST, tk.getMarketOptionLive(), service);
    //request.addHeader("TKI_OVERRIDE", "true");
    request.addPayload(fixml.getLimitFixmlString());
    service.signRequest(accessToken, request);
    Response response = request.send();

    try {
        order = parseJSON(response);
    } catch (JSONException e) {
        e.printStackTrace();
        order.setError(e.toString());
    }

    return order;
}
 
开发者ID:mikemey01,项目名称:Markets,代码行数:26,代码来源:ParseOptionOrder.java

示例2: doInBackground

protected OptionOrderPreview doInBackground(Void... voids){
    OptionOrderPreview order = new OptionOrderPreview();

    //Build the OAuth service
    final OAuth10aService service = new ServiceBuilder()
            .apiKey(apiKeys.CONSUMER_KEY)
            .apiSecret(apiKeys.CONSUMER_SECRET)
            .build(TradeKingApi.instance());
    Token accessToken = new Token(apiKeys.OAUTH_TOKEN, apiKeys.OAUTH_TOKEN_SECRET);

    // Fetch the JSON data
    OAuthRequest request = new OAuthRequest(Verb.POST, tk.getMarketOptionPreview(), service);
    request.addPayload(fixml.getMarketFixmlString());
    service.signRequest(accessToken, request);
    Response response = request.send();

    try {
        order = parseJSON(response);
    } catch (JSONException e) {
        e.printStackTrace();
        order.setError(e.toString());
    }

    return order;
}
 
开发者ID:mikemey01,项目名称:Markets,代码行数:25,代码来源:ParseOptionOrderPreview.java

示例3: getSingleUseToken

public String getSingleUseToken() {
    OAuth10aService service = JamAuthConfig.instance().getOAuth10aService();
    final OAuthRequest request = new OAuthRequest(Verb.POST,
            JamAuthConfig.instance().getServerUrl() + "/v1/single_use_tokens",
            service);
    service.signRequest(JamAuthConfig.instance().getOAuth10aAccessToken(), request);

    final Response response = request.send();
    String body = response.getBody();

    Matcher matcher = SINGLE_USE_TOKEN_PATTERN.matcher(body);
    if (matcher.find()) {
        return matcher.group(0);
    }
    return null;
}
 
开发者ID:SAP,项目名称:SAPJamSampleCode,代码行数:16,代码来源:JamAuthConfig.java

示例4: getMethod

public static Verb getMethod(String method) {
	switch (method) {
		case "GET":
			return Verb.GET;
		case "POST":
			return Verb.POST;
		case "DELETE":
			return Verb.DELETE;
		case "PUT":
			return Verb.PUT;
		case "PATCH":
			return Verb.PATCH;
		case "OPTIONS":
			return Verb.OPTIONS;
	}
	throw new IllegalStateException(method);
}
 
开发者ID:codepath,项目名称:android-oauth-handler,代码行数:17,代码来源:ScribeRequestAdapter.java

示例5: createChallenge

@Override
public void createChallenge (App application, UserProfile target, String message) {
    if (target == null) {
        new ErrorMessage(ERROR).showError();
        return;
    }
    OAuthRequest myRequest = new OAuthRequest(Verb.POST,
                                              String.format(CHALLENGE_URL, target.getID()),
                                              application.getLogin().getService());
    myRequest.addBodyParameter("message", message);
    setRequest(myRequest);
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:12,代码来源:FacebookChallenge.java

示例6: createPost

@Override
public void createPost (String message, SocialProfile profile) {
    OAuthRequest myRequest = new OAuthRequest(Verb.POST,
                                              String.format(POST_URL, profile.getID()),
                                              profile.getLogin().getService());
    myRequest.addBodyParameter("message", message);
    setRequest(myRequest);
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:8,代码来源:FacebookCustomPost.java

示例7: getAccessTokenVerb

@Override
public Verb getAccessTokenVerb() {
    if (this.springSecurityCompliant) {
        return Verb.PUT;
    } else {
        return Verb.POST;
    }
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:8,代码来源:CasOAuthWrapperApi20.java

示例8: setAccessTokenVerb

public ConfigurableApi setAccessTokenVerb(String verb) {
    if (verb.equalsIgnoreCase("GET")) {
        accessTokenVerb = Verb.GET;
    } else if (verb.equalsIgnoreCase("POST")) {
        accessTokenVerb = Verb.POST;
    } else {
        Log.e("ConfigurableApi", "Expected GET or POST string values for accessTokenVerb.");
    }

    return this;
}
 
开发者ID:fullstackreact,项目名称:react-native-oauth,代码行数:11,代码来源:ConfigurableApi.java

示例9: createRequest

private OAuthRequest createRequest (LoginObject login, String url) {
    OAuthRequest request =
            new OAuthRequest(Verb.POST, url, login.getService());
    request.addBodyParameter("template", myMessage);
    return request;
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:6,代码来源:FacebookNotifyUsers.java

示例10: changed

@Override
public void changed (ObservableValue<? extends State> ov, State oldState, State newState) {
    if (newState == Worker.State.SUCCEEDED) {
        String newURL = myPage.getEngine().getLocation();
        System.out.println("new URL" + newURL);
        Pattern pattern = Pattern.compile("code=([^&]+)");
        Matcher m = pattern.matcher(newURL);
        if (m.find()) {

            System.out.println(m.group(1));
            OAuth2AccessToken accessToken = service.getAccessToken(m.group(1));
            System.out.println("Got the Access Token!");
            System.out.println("(if your curious it looks like this: " + accessToken +
                               ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
            System.out.println(accessToken.getAccessToken());

            System.out.println(accessToken.getAccessToken());

            // Now let's go and ask for a protected resource!
            System.out.println("Now we're going to access a protected resource...");
            final OAuthRequest request =
                    new OAuthRequest(Verb.GET, GOOGLE_PROTECTED_RESOURCE_URL, service);
            service.signRequest(accessToken, request);
            final Response response = request.send();
            System.out.println(request.getBodyContents());
            System.out.println("Got it! Lets see what we found...");
            System.out.println();
            System.out.println(response.getCode());
            System.out.println(response.getBody());
            m = Pattern.compile("\"email\":\"([^&]+)\"").matcher(response.getBody());
            if (m.find()) {
                System.out.println(m.group(1));
            }

            // SEND A NOTIFICATION
            OAuthRequest nextRequest =
                    new OAuthRequest(Verb.POST,
                                     "https://www.googleapis.com/plusDomains/v1/people/me/activities",
                                     service);
            // String message = "Let's make tower defense!";
            // nextRequest.addBodyParameter("object",);
            // nextRequest.addBodyParameter("ids", "10204226196654701");
            service.signRequest(accessToken, nextRequest);

            Response nextResponse = nextRequest.send();
            System.out.println("here");
            System.out.println(nextRequest.getBodyContents());
            System.out.println(nextResponse.getCode());
            String responseBody = nextResponse.getBody();
            System.out.println(responseBody);
            //
            //

        }
        else {

        }
    }
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:59,代码来源:BrowserView.java

示例11: getAccessTokenVerb

@Override
public Verb getAccessTokenVerb() {
    return Verb.POST;
}
 
开发者ID:jpmeijers,项目名称:ttnmapper_android_v2,代码行数:4,代码来源:TheThingsNetworkOathApi.java

示例12: getAccessTokenVerb

@Override
public Verb getAccessTokenVerb() {
  return Verb.POST;
}
 
开发者ID:SonarSource,项目名称:sonar-auth-github,代码行数:4,代码来源:ScribeGitHubApi.java


注:本文中的com.github.scribejava.core.model.Verb.POST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。