agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/http/HTTP.java
/**
	 * Makes HTTP POST on path with given form parameters and  headers.
	 * @param path
	 * @param mappedFormParameters
	 * @param mappedHeaders
	 * @return raw http response object with entity in tact
	 * @throws IOException
	 * @throws RemoteDataException
	 */
Makes HTTP POST on path with given form parameters and  headers.
Makes HTTP POST on path with given form parameters and headers .
public CloseableHttpResponse doPost(String path, Map<String, String> mappedFormParameters, Map<String, String> mappedHeaders)
	throws IOException, RemoteDataException
	{
		try 
		{
			URI escapedUri = getUriForPath(path);
			HttpPost httpPost = new HttpPost(escapedUri);
		    if (mappedFormParameters != null && !mappedFormParameters.isEmpty()) 
		    {
		    	List <NameValuePair> nvps = new ArrayList <NameValuePair>();
		    	for (String key: mappedFormParameters.keySet()) {
		    		nvps.add(new BasicNameValuePair(key, mappedFormParameters.get(key)));
		    	}
		    	httpPost.setEntity(new UrlEncodedFormEntity(nvps));
		    }
		    if (mappedHeaders != null && !mappedHeaders.isEmpty()) 
		    {
		    	for (String key: mappedHeaders.keySet()) {
		    		httpPost.addHeader(key, mappedHeaders.get(key));
		    	}
		    }
			return doRequest(escapedUri, httpPost);
		}
		catch (IOException e) {
			throw e;
		}
		catch (Exception e) {
			throw new RemoteDataException("Failed to establish output stream to " + path, e);
		}
	}
public CloseableHttpResponse doPost ( String path , Map < String , String > mappedFormParameters , Map < String , String > mappedHeaders ) throws IOException , RemoteDataException { try { URI escapedUri = getUriForPath ( path ) ; HttpPost httpPost = new HttpPost ( escapedUri ) ; if ( mappedFormParameters != null && ! mappedFormParameters . isEmpty ( ) ) { List < NameValuePair > nvps = new ArrayList < NameValuePair > ( ) ; for ( String key : mappedFormParameters . keySet ( ) ) { nvps . add ( new BasicNameValuePair ( key , mappedFormParameters . get ( key ) ) ) ; } httpPost . setEntity ( new UrlEncodedFormEntity ( nvps ) ) ; } if ( mappedHeaders != null && ! mappedHeaders . isEmpty ( ) ) { for ( String key : mappedHeaders . keySet ( ) ) { httpPost . addHeader ( key , mappedHeaders . get ( key ) ) ; } } return doRequest ( escapedUri , httpPost ) ; } catch ( IOException e ) { throw e ; } catch ( Exception e ) { throw new RemoteDataException ( "Failed to establish output stream to " + path , e ) ; } }
Makes HTTP POST on path with given form parameters and  headers.
Makes HTTP POST on path with given form parameters and headers .