package com.darwinsys.clientware;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

/**
 * A RESTful (JAX-RS) client NOT using the JAX-RS Client API
 * In fact, not using anything except Core Java APIs.
 */
public class UrlRestClient {

	public static void main(String[] args) throws Exception {
		
		// IRL this would come from the user, or ??
		final int recipeId = 4;
		
		// String concat, but ints cannot contain injection data
		URL url = new URL(Constants.ACB_BASE_URL + "/" + recipeId);
		final HttpURLConnection connection = (HttpURLConnection) url.openConnection();
		connection.addRequestProperty("Accept", "application/json");
		InputStream is = connection.getInputStream();
		// Read "is" to get the response from a GET
		BufferedReader bi = new BufferedReader(new InputStreamReader(is));
		String line = null;
		while ((line = bi.readLine()) != null) {
			System.out.println(line);
		}
	}
}

@@ -569,17 +569,80 @@
 BASE_URL
- 
+%0A%09%09%09%09.replace(%22https%22, %22http%22) // remove when 577 rewritten%0A%09%09%09%09
 + %22/%22 + 

Make the simple demo fall back to http