agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/http/HTTP.java
/**
	 * Makes HTTP POST with serialized JSON and content type of application/json and given headers. 
	 * @param path
	 * @param json
	 * @param mappedHeaders
	 * @return raw http response object with entity in tact
	 * @throws IOException
	 * @throws RemoteDataException
	 */
Makes HTTP POST with serialized JSON and content type of application/json and given headers.
Makes HTTP POST with serialized JSON and content type of application / json and given headers .
public CloseableHttpResponse doPostJson(String path, JsonNode json, Map<String, String> mappedHeaders)
	throws IOException, RemoteDataException
	{
		try 
		{
			URI escapedUri = getUriForPath(path);
			HttpPost httpPost = new HttpPost(escapedUri);
			httpPost.setEntity(new StringEntity(
				    json == null ? "" : json.toString(),
				    "application/json"));
		    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 post multipart form to " + path, e);
		}
	}
public CloseableHttpResponse doPostJson ( String path , JsonNode json , Map < String , String > mappedHeaders ) throws IOException , RemoteDataException { try { URI escapedUri = getUriForPath ( path ) ; HttpPost httpPost = new HttpPost ( escapedUri ) ; httpPost . setEntity ( new StringEntity ( json == null ? "" : json . toString ( ) , "application/json" ) ) ; 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 post multipart form to " + path , e ) ; } }
Makes HTTP POST with serialized JSON and content type of application/json and given headers.
Makes HTTP POST with serialized JSON and content type of application / json and given headers .
// add headers // make request