public request ( |
||
url | Url of the service to call | |
httpMethod | string | |
oauthToken | string | oauth token (if exists) |
oauthTokenSecret | string | oauth token secret (if exists) |
extraParameters | List |
the list of parameters to send the service |
Результат | string |
public string getRequestToken(List<QueryParameter> extraparameters, string postextra) { string oauth_token = this._oauthConfig.OauthToken; OAuthRequest request = new OAuthRequest(this, base._debugType); string tokens = request.request(new Uri(this._oauthConfig.RequestTokenUrl), "GET", oauth_token, "", extraparameters, postextra ).ToString(); if (tokens == String.Empty || tokens.Length == 0) return null; // Save Tokens in Configuration this._saveTokenDataInConfiguration(tokens); // Open Authorization Page this._openAuthorizationPage(); return tokens; }
public string getRequestToken() { string oauth_token = this._oauthConfig.OauthToken; OAuthRequest request = new OAuthRequest(this, base._debugType); string tokens = request.request(new Uri(this._oauthConfig.RequestTokenUrl), "GET", oauth_token, "", null).ToString(); if (tokens == String.Empty || tokens.Length == 0) { return(null); } // Save Tokens in Configuration this._saveTokenDataInConfiguration(tokens); // Open Authorization Page this._openAuthorizationPage(); return(tokens); }
public string getAccessToken(string oauth_verifier) { string oauth_token = this._oauthConfig.OauthToken; string oauth_token_secret = this._oauthConfig.OauthTokenSecret; List <QueryParameter> parameters = new List <QueryParameter>(); //parameters.Add(new QueryParameter("oauth_token", oauth_token)); parameters.Add(new QueryParameter("oauth_verifier", oauth_verifier)); OAuthRequest request = new OAuthRequest(this, base._debugType); string tokens = request.request(new Uri(this._oauthConfig.AccessTokenUrl), "GET", oauth_token, oauth_token_secret, parameters).ToString(); if (tokens == String.Empty || tokens.Length == 0) { return(null); } // Save Tokens in Configuration this._saveTokenDataInConfiguration(tokens); return(tokens); }
public Object request(string url, string httpMethod, List <QueryParameter> parameters, string responseFormat) { string oauth_token = this._oauthConfig.OauthToken; string oauth_token_secret = this._oauthConfig.OauthTokenSecret; OAuthRequest request = new OAuthRequest(this, base._debugType); string response = request.request(new Uri(url), httpMethod, oauth_token, oauth_token_secret, parameters).ToString(); if (response == String.Empty || response.Length == 0) { base._debug("The Request Response was empty"); return(null); } Object result = null; switch (responseFormat) { case "DataSet": System.IO.StringReader strreader = new System.IO.StringReader(response); DataSet ds = new DataSet(); ds.ReadXml(strreader); result = ds; break; case "XML": System.IO.StringReader strxmlreader = new System.IO.StringReader(response); XmlTextReader xmlReader = new XmlTextReader(strxmlreader); xmlReader.Read(); result = xmlReader; break; case "PLAIN": default: result = response; break; } return(result); }
public Object request(string url, string httpMethod, List<QueryParameter> parameters, string responseFormat) { string oauth_token = this._oauthConfig.OauthToken; string oauth_token_secret = this._oauthConfig.OauthTokenSecret; OAuthRequest request = new OAuthRequest(this, base._debugType); string response = request.request(new Uri(url), httpMethod, oauth_token, oauth_token_secret, parameters).ToString(); if (response == String.Empty || response.Length == 0) { base._debug("The Request Response was empty"); return null; } Object result = null; switch (responseFormat) { case "DataSet": System.IO.StringReader strreader = new System.IO.StringReader(response); DataSet ds = new DataSet(); ds.ReadXml(strreader); result = ds; break; case "XML": System.IO.StringReader strxmlreader = new System.IO.StringReader(response); XmlTextReader xmlReader = new XmlTextReader(strxmlreader); xmlReader.Read(); result = xmlReader; break; case "PLAIN": default: result = response; break; } return result; }
public string getAccessToken(string oauth_verifier) { string oauth_token = this._oauthConfig.OauthToken; string oauth_token_secret = this._oauthConfig.OauthTokenSecret; List<QueryParameter> parameters = new List<QueryParameter>(); //parameters.Add(new QueryParameter("oauth_token", oauth_token)); parameters.Add(new QueryParameter("oauth_verifier", oauth_verifier)); OAuthRequest request = new OAuthRequest(this, base._debugType); string tokens = request.request(new Uri(this._oauthConfig.AccessTokenUrl), "GET", oauth_token, oauth_token_secret, parameters, "").ToString(); if (tokens == String.Empty || tokens.Length == 0) return null; // Save Tokens in Configuration this._saveTokenDataInConfiguration(tokens); return tokens; }