示例#1
0
 /**
  * Get a {@link ParameterList} with the query string parameters.
  * 
  * @return a {@link ParameterList} containing the query string parameters.
  * @throws OAuthException if the request URL is not valid.
  */
 public ParameterList getQueryStringParams()
 {
   try
   {
     ParameterList result = new ParameterList();
     String queryString = new URL(url).getQuery();
     result.addQuerystring(queryString);
     result.addAll(querystringParams);
     return result;
   }
   catch (MalformedURLException mue)
   {
     throw new OAuthException("Malformed URL", mue);
   }
 }
示例#2
0
 byte[] getByteBodyContents()
 {
   if (bytePayload != null) return bytePayload;
   String body = (payload != null) ? payload : bodyParams.asFormUrlEncodedString();
   try
   {
     return body.getBytes(getCharset());
   }
   catch(UnsupportedEncodingException uee)
   {
     throw new OAuthException("Unsupported Charset: "+getCharset(), uee);
   }
 }
示例#3
0
 /**
  * Returns the complete url (host + resource + encoded querystring parameters).
  *
  * @return the complete url.
  */
 public String getCompleteUrl()
 {
   return querystringParams.appendTo(url);
 }