Tabnine Logo
HttpRequest.getPostBodyLength
Code IndexAdd Tabnine to your IDE (free)

How to use
getPostBodyLength
method
in
org.apache.shindig.gadgets.http.HttpRequest

Best Java code snippets using org.apache.shindig.gadgets.http.HttpRequest.getPostBodyLength (Showing top 10 results out of 315)

origin: org.apache.shindig/shindig-gadgets

private static String getBodyHash(final HttpRequest request, final byte[] key,
    final String algorithm) throws UnsupportedEncodingException, GeneralSecurityException {
 if (request.getPostBodyLength() > 0) {
  final byte[] text = MacTokenHandler.getBody(request);
  final byte[] hashed = MacTokenHandler.hash(text, key, algorithm);
  return new String(hashed, "UTF-8");
 }
 return "";
}
origin: org.apache.shindig/shindig-gadgets

 : new HttpPut(requestUri);
if (request.getPostBodyLength() > 0) {
 enclosingMethod.setEntity(new InputStreamEntity(request.getPostBody(), request.getPostBodyLength()));
origin: com.lmco.shindig/shindig-gadgets

 : new HttpPut(requestUri);
if (request.getPostBodyLength() > 0) {
 enclosingMethod.setEntity(new InputStreamEntity(request.getPostBody(), request.getPostBodyLength()));
origin: org.gatein.shindig/shindig-gadgets

 : new HttpPut(requestUri);
if (request.getPostBodyLength() > 0) {
 enclosingMethod.setEntity(new InputStreamEntity(request.getPostBody(), request.getPostBodyLength()));
origin: org.gatein.shindig/shindig-gadgets

if (result.getPostBodyLength() == 0) {
 result.setPostBody(CharsetUtil.getUtf8Bytes(oauthData));
} else {
origin: org.apache.shindig/shindig-gadgets

@Test
public void postBodyCopied() throws Exception {
 HttpRequest request  = new HttpRequest(DEFAULT_URI).setPostBody(POST_BODY.getBytes());
 assertEquals(POST_BODY.length(), request.getPostBodyLength());
 assertEquals(POST_BODY, IOUtils.toString(request.getPostBody(), "UTF-8"));
 assertEquals(POST_BODY, request.getPostBodyAsString());
}
origin: org.apache.shindig/shindig-gadgets

if (result.getPostBodyLength() == 0) {
 result.setPostBody(CharsetUtil.getUtf8Bytes(oauthData));
} else {
origin: com.lmco.shindig/shindig-gadgets

if (result.getPostBodyLength() == 0) {
 result.setPostBody(CharsetUtil.getUtf8Bytes(oauthData));
} else {
origin: com.lmco.shindig/shindig-gadgets

@Test
public void postBodyCopied() throws Exception {
 HttpRequest request  = new HttpRequest(DEFAULT_URI).setPostBody(POST_BODY.getBytes());
 assertEquals(POST_BODY.length(), request.getPostBodyLength());
 assertEquals(POST_BODY, IOUtils.toString(request.getPostBody(), "UTF-8"));
 assertEquals(POST_BODY, request.getPostBodyAsString());
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void postBodyCopied() throws Exception {
 HttpRequest request  = new HttpRequest(DEFAULT_URI).setPostBody(POST_BODY.getBytes());
 assertEquals(POST_BODY.length(), request.getPostBodyLength());
 assertEquals(POST_BODY, IOUtils.toString(request.getPostBody(), "UTF-8"));
 assertEquals(POST_BODY, request.getPostBodyAsString());
}
org.apache.shindig.gadgets.httpHttpRequestgetPostBodyLength

Javadoc

Retrieves the total length of the post body.

Popular methods of HttpRequest

  • <init>
    Clone an existing HttpRequest.
  • addHeader
    Add a single header to the request. If a value for the given name is already set, a second value is
  • getAuthType
  • getCacheTtl
  • getContainer
  • getFollowRedirects
  • getGadget
  • getHeader
  • getHeaders
  • getIgnoreCache
  • getMethod
  • getOAuthArguments
  • getMethod,
  • getOAuthArguments,
  • getParam,
  • getParamAsInteger,
  • getPostBody,
  • getPostBodyAsString,
  • getRewriteMimeType,
  • getSecurityToken,
  • getUri

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JList (javax.swing)
  • JTable (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now