Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

issue# (TFJ-737)

Using API1.1 verify credentials URL if possible.
  • Loading branch information...
commit 8f9774394b2cbc565e910bda7cd4800afcabce04 1 parent 94d89b0
Naoya Hatayama ApplePedlar authored
8 twitter4j-media-support/src/main/java/twitter4j/media/AbstractImageUploadImpl.java
View
@@ -35,8 +35,12 @@
* @since Twitter4J 2.1.8
*/
abstract class AbstractImageUploadImpl implements ImageUpload {
- public static final String TWITTER_VERIFY_CREDENTIALS_JSON = "https://api.twitter.com/1/account/verify_credentials.json";
- public static final String TWITTER_VERIFY_CREDENTIALS_XML = "https://api.twitter.com/1/account/verify_credentials.xml";
+ @Deprecated
+ public static final String TWITTER_VERIFY_CREDENTIALS_JSON_V1 = "https://api.twitter.com/1/account/verify_credentials.json";
+ @Deprecated
+ public static final String TWITTER_VERIFY_CREDENTIALS_XML_V1 = "https://api.twitter.com/1/account/verify_credentials.xml";
+
+ public static final String TWITTER_VERIFY_CREDENTIALS_JSON_V1_1 = "https://api.twitter.com/1.1/account/verify_credentials.json";
private HttpClientWrapper client;
4 twitter4j-media-support/src/main/java/twitter4j/media/ImgLyUpload.java
View
@@ -56,9 +56,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "http://img.ly/api/2/upload.json";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
HttpParameter[] params = {this.image};
4 twitter4j-media-support/src/main/java/twitter4j/media/MobypictureUpload.java
View
@@ -57,9 +57,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "https://api.mobypicture.com/2.0/upload.json";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
if (null == apiKey) {
4 twitter4j-media-support/src/main/java/twitter4j/media/PlixiUpload.java
View
@@ -56,9 +56,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_XML);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_XML_V1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_XML);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_XML_V1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
if (null == apiKey) {
4 twitter4j-media-support/src/main/java/twitter4j/media/PosterousUpload.java
View
@@ -57,9 +57,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "http://posterous.com/api2/upload.json";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
HttpParameter[] params = {this.image};
2  twitter4j-media-support/src/main/java/twitter4j/media/TwippleUpload.java
View
@@ -53,7 +53,7 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "http://p.twipple.jp/api/upload";
- String signedVerifyCredentialsURL = generateVerifyCredentialsAuthorizationURL(TWITTER_VERIFY_CREDENTIALS_XML);
+ String signedVerifyCredentialsURL = generateVerifyCredentialsAuthorizationURL(TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
this.postParameter = new HttpParameter[]{
new HttpParameter("verify_url", signedVerifyCredentialsURL),
4 twitter4j-media-support/src/main/java/twitter4j/media/TwitgooUpload.java
View
@@ -67,9 +67,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "http://twitgoo.com/api/uploadAndPost";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
HttpParameter[] params = {
4 twitter4j-media-support/src/main/java/twitter4j/media/TwitpicUpload.java
View
@@ -58,9 +58,9 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "https://twitpic.com/api/2/upload.json";
- String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON);
+ String verifyCredentialsAuthorizationHeader = generateVerifyCredentialsAuthorizationHeader(TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
- headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON);
+ headers.put("X-Auth-Service-Provider", TWITTER_VERIFY_CREDENTIALS_JSON_V1_1);
headers.put("X-Verify-Credentials-Authorization", verifyCredentialsAuthorizationHeader);
if (null == apiKey) {
2  twitter4j-media-support/src/main/java/twitter4j/media/YFrogUpload.java
View
@@ -57,7 +57,7 @@ protected String postUpload() throws TwitterException {
@Override
protected void preUpload() throws TwitterException {
uploadUrl = "https://yfrog.com/api/upload";
- String signedVerifyCredentialsURL = generateVerifyCredentialsAuthorizationURL(TWITTER_VERIFY_CREDENTIALS_XML);
+ String signedVerifyCredentialsURL = generateVerifyCredentialsAuthorizationURL(TWITTER_VERIFY_CREDENTIALS_XML_V1);
Twitter tw = new TwitterFactory().getInstance(this.oauth);
HttpParameter[] params = {
Please sign in to comment.
Something went wrong with that request. Please try again.