com.microsoft.aad.adal
Class WebRequestHandler

java.lang.Object
  extended by com.microsoft.aad.adal.WebRequestHandler
All Implemented Interfaces:
IWebRequestHandler

public class WebRequestHandler
extends Object
implements IWebRequestHandler

It uses one time async task. WebRequest are wrapped here to prevent multiple reuses for same tasks. Each request returns a handler for cancel action. Call this from UI thread to correctly create async task and execute.


Field Summary
static String HEADER_ACCEPT
          Header for accept.
static String HEADER_ACCEPT_JSON
          Header for json type.
 
Constructor Summary
WebRequestHandler()
          Creates http request.
 
Method Summary
 HttpWebResponse sendGet(URL url, HashMap<String,String> headers)
           
 HttpWebResponse sendPost(URL url, HashMap<String,String> headers, byte[] content, String contentType)
           
 void setRequestCorrelationId(UUID requestCorrelationId)
          Sets correlationId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_ACCEPT

public static final String HEADER_ACCEPT
Header for accept.

See Also:
Constant Field Values

HEADER_ACCEPT_JSON

public static final String HEADER_ACCEPT_JSON
Header for json type.

See Also:
Constant Field Values
Constructor Detail

WebRequestHandler

public WebRequestHandler()
Creates http request.

Method Detail

sendGet

public HttpWebResponse sendGet(URL url,
                               HashMap<String,String> headers)
Specified by:
sendGet in interface IWebRequestHandler

sendPost

public HttpWebResponse sendPost(URL url,
                                HashMap<String,String> headers,
                                byte[] content,
                                String contentType)
Specified by:
sendPost in interface IWebRequestHandler

setRequestCorrelationId

public void setRequestCorrelationId(UUID requestCorrelationId)
Sets correlationId.

Specified by:
setRequestCorrelationId in interface IWebRequestHandler
Parameters:
requestCorrelationId - UUID


Copyright © 2003–2015. All rights reserved.