AeroGear Android Library 1.1.0

org.jboss.aerogear.android.http
Interface HttpProvider

All Known Implementing Classes:
HttpRestProvider

public interface HttpProvider

A suite a convenience functions which wrap and clean up common HTTP request operations.


Method Summary
 HeaderAndBody delete(String id)
          Issues an HTTP request, consumes the content, and cleans up after itself.
 HeaderAndBody get()
          Issues an HTTP request, consumes the content, and cleans up after itself.
 URL getUrl()
           
 HeaderAndBody post(byte[] data)
          Issues an HTTP request, consumes the content, and cleans up after itself.
 HeaderAndBody post(String data)
          Issues an HTTP request, consumes the content, and cleans up after itself.
 HeaderAndBody put(String id, byte[] data)
          Issues an HTTP request, consumes the content, and cleans up after itself.
 HeaderAndBody put(String id, String data)
          Issues an HTTP request, consumes the content, and cleans up after itself.
 void setDefaultHeader(String headerName, String headerValue)
          Will set a default header value to be used on all calls
 

Method Detail

getUrl

URL getUrl()

get

HeaderAndBody get()
                  throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

post

HeaderAndBody post(String data)
                   throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

post

HeaderAndBody post(byte[] data)
                   throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

put

HeaderAndBody put(String id,
                  String data)
                  throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

put

HeaderAndBody put(String id,
                  byte[] data)
                  throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

delete

HeaderAndBody delete(String id)
                     throws HttpException
Issues an HTTP request, consumes the content, and cleans up after itself.

Returns:
the HeaderAndBody response from the server
Throws:
HttpException - if the http request doesn't return status 200

setDefaultHeader

void setDefaultHeader(String headerName,
                      String headerValue)
Will set a default header value to be used on all calls

Parameters:
headerName - name
headerValue - value

AeroGear Android Library 1.1.0

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.