// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


            Iterator<String> itr = conn.getHeaderFields().keySet().iterator();
            Map<String, String> headers = new HashMap();
            while (itr.hasNext()) {
                String key = itr.next();
                if (key != null) {
                    headers.put(key, conn.getHeaderField(key));
                }
            }
            return new HttpResponse(sb.toString(), conn.getResponseCode(), headers);

        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }
    }

    /**
     * Reads data from the data reader and posts it to a server via POST request.
     * data - The data you want to send
     * endpoint - The server's address
     * output - writes the server's response to output
     *
     * @param data     Data to be sent
     * @param endpoint The endpoint to which the data has to be POSTed
     * @param output   Output
     * @throws AutomationFrameworkException If an error occurs while POSTing
     */
// Path: test-automation-framework/org.wso2.carbon.automation.engine/src/main/java/org/wso2/carbon/automation/engine/exceptions/AutomationFrameworkException.java
// public class AutomationFrameworkException extends Exception {
//     public AutomationFrameworkException(String message) {
//         super(message);
//     }
// 
//     public AutomationFrameworkException(String message, Throwable e) {
//         super(message, e);
//     }
// 
//     public AutomationFrameworkException(Throwable e) {
//         super(e);
//     }
// }


// Path: test-automation-framework/org.wso2.carbon.automation.test.utils/src/main/java/org/wso2/carbon/automation/test/utils/http/client/HttpRequestUtil.java
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;



            Iterator<String> itr = conn.getHeaderFields().keySet().iterator();
            Map<String, String> headers = new HashMap();
            while (itr.hasNext()) {
                String key = itr.next();
                if (key != null) {
                    headers.put(key, conn.getHeaderField(key));
                }
            }
            return new HttpResponse(sb.toString(), conn.getResponseCode(), headers);

        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }
    }

    /**
     * Reads data from the data reader and posts it to a server via POST request.
     * data - The data you want to send
     * endpoint - The server's address
     * output - writes the server's response to output
     *
     * @param data     Data to be sent
     * @param endpoint The endpoint to which the data has to be POSTed
     * @param output   Output
     * @throws AutomationFrameworkException If an error occurs while POSTing
     */
    public static void sendPostRequest(Reader data, URL endpoint, Writer output) throws AutomationFrameworkException {