diff options
Diffstat (limited to 'src/main/java/com/mavlushechka/a1qa/driverUtils')
-rw-r--r-- | src/main/java/com/mavlushechka/a1qa/driverUtils/HttpURLConnectionFactory.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/mavlushechka/a1qa/driverUtils/HttpURLConnectionFactory.java b/src/main/java/com/mavlushechka/a1qa/driverUtils/HttpURLConnectionFactory.java index 6b60b64..13145c4 100644 --- a/src/main/java/com/mavlushechka/a1qa/driverUtils/HttpURLConnectionFactory.java +++ b/src/main/java/com/mavlushechka/a1qa/driverUtils/HttpURLConnectionFactory.java @@ -1,5 +1,6 @@ package com.mavlushechka.a1qa.driverUtils; +import com.mavlushechka.a1qa.constants.RequestMethod; import com.mavlushechka.a1qa.utils.JSONParser; import java.io.IOException; @@ -11,10 +12,10 @@ public class HttpURLConnectionFactory { private HttpURLConnectionFactory() { } - public static HttpURLConnection createHttpURLConnection(String spec, String requestMethod, boolean doOutput) throws IOException { + public static HttpURLConnection createHttpURLConnection(String spec, RequestMethod requestMethod, boolean doOutput) throws IOException { HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(JSONParser.parseData("config", "browser.url") + spec).openConnection(); - httpURLConnection.setRequestMethod(requestMethod); + httpURLConnection.setRequestMethod(requestMethod.name()); httpURLConnection.setConnectTimeout(Integer.parseInt(JSONParser.parseData("config", "httpURLConnection.connectTimeout"))); httpURLConnection.setReadTimeout(Integer.parseInt(JSONParser.parseData("config", "httpURLConnection.readTimeout"))); httpURLConnection.setDoOutput(doOutput); |