Code example for HttpUriRequest

Methods: addHeader, getURI

0
	 * Adds the Authorization header to a request 
	 * @param request	The request to modify 
	 * @throws InvalidKeyException 
	 */ 
	private void addAuthorizationHeader(HttpUriRequest request) throws InvalidKeyException {
		String token = generateAuthToken(request.getURI().toString());
 
		request.addHeader(AUTHORIZATION_HEADER, token);
	} 
 
	/** 
	 * Generates an AuthToken 
	 * @param url	The target URL 
	 * @return	An AuthToken 
	 * @throws InvalidKeyException 
	 */ 
	private String generateAuthToken(String url) throws InvalidKeyException {
 
		String keyName = mConnectionData.get(SHARED_ACCESS_KEY_NAME);
		String key = mConnectionData.get(SHARED_ACCESS_KEY);