au.edu.anu.portal.portlets.basiclti.support
Class HttpSupport

java.lang.Object
  extended by au.edu.anu.portal.portlets.basiclti.support.HttpSupport

public class HttpSupport
extends Object

HTTP support class. Takes care of HTTP related methods

Author:
Steve Swinsburg (steve.swinsburg@anu.edu.au)

Constructor Summary
HttpSupport()
           
 
Method Summary
static Map<String,String> deserialiseParameterMap(Map<String,String[]> params)
          Deserialise the result of request.getParameterMap to convert a query string back into a single valued map.
static String doPost(String address, Map<String,String> params)
          Make a POST request with the given Map of parameters to be encoded
static String postLaunchHtml(String address, Map<String,String> params)
          Generate a HTML form that will automatically submit itself, based on the parameters supplied.
static String serialiseMapToQueryString(Map<String,String> params)
          Serialise the given Map of parameters to a URL query string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSupport

public HttpSupport()
Method Detail

doPost

public static String doPost(String address,
                            Map<String,String> params)
Make a POST request with the given Map of parameters to be encoded

Parameters:
address - address to POST to
params - Map of params to use as the form parameters
Returns:

serialiseMapToQueryString

public static String serialiseMapToQueryString(Map<String,String> params)
Serialise the given Map of parameters to a URL query string

Parameters:
params - Map of params
Returns:

deserialiseParameterMap

public static Map<String,String> deserialiseParameterMap(Map<String,String[]> params)
Deserialise the result of request.getParameterMap to convert a query string back into a single valued map.

Note, only the first value is kept.

Parameters:
map - Map map from request.getParameterMap
Returns:

postLaunchHtml

public static String postLaunchHtml(String address,
                                    Map<String,String> params)
Generate a HTML form that will automatically submit itself, based on the parameters supplied. This is so the client does the POST and gets the session cookie back from the endpoint.

Parameters:
endpoint -
params -
Returns:


Copyright © 2010-2012 Division of Information, Australian National University. All Rights Reserved.