本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例7: getAccessTokenVerb
@Override
public Verb getAccessTokenVerb() {
if (this.springSecurityCompliant) {
return Verb.PUT;
} else {
return Verb.POST;
}
}
示例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;
}
示例9: createRequest
private OAuthRequest createRequest (LoginObject login, String url) {
OAuthRequest request =
new OAuthRequest(Verb.POST, url, login.getService());
request.addBodyParameter("template", myMessage);
return request;
}
示例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 {
}
}
}
示例11: getAccessTokenVerb
@Override
public Verb getAccessTokenVerb() {
return Verb.POST;
}
示例12: getAccessTokenVerb
@Override
public Verb getAccessTokenVerb() {
return Verb.POST;
}