title: java.net.UnknownHostException: HTTPS exception when running Rest Assured
body: <p>I'm trying to convert http calls to rest-assured.  However, I'm getting an "UnknownHostException: https" error when trying to do the post with Rest Assured.  Any ideas?</p>
  
  <p>Here is the non-restassured code which works perfectly (sHost = <a href="https://akab-" rel="nofollow noreferrer">https://akab-</a><em>hidden</em>.purge.akamaiapis.net):</p>
  
  <pre><code>HttpTransport httpTransport = new ApacheHttpTransport();
  HttpRequestFactory requestFactory = httpTransport.createRequestFactory();
  URI uri = new URI("https", sHost, "/ccu/v3/invalidate/cpcode/production", null, null);
  HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(uri), ByteArrayContent.fromString("application/json", sRequestBody));
  GoogleHttpClientEdgeGridRequestSigner requestSigner = new GoogleHttpClientEdgeGridRequestSigner(credential);
  requestSigner.sign(request);
  response = request.execute();
  </code></pre>
  
  <p>Now for the restassured code I have tried and wish to use which throws an exception  I'm pretty sure the problem is in the .baseURI().  I had the same problem in the above code in the URI declaration:</p>
  
  <pre><code>Response postResponse = given()
          .baseUri(sHost)
          .filter(new RestAssuredEdgeGridFilter(credential))
          .accept(ContentType.JSON)
          .contentType(ContentType.JSON)
          .body(sRequestBody)
  .expect()
          .statusCode(201)
  .when()
          .post("/ccu/v3/invalidate/cpcode/production")
  .then()
          .log()
              .all()
          .extract()
              .response();
  </code></pre>
  
  <p>On the .post() line, the following exception is thrown:</p>
  
  <pre><code>java.net.UnknownHostException: https
      at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
      at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
      at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
      at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
      at java.net.InetAddress.getAllByName(InetAddress.java:1192)
      at java.net.InetAddress.getAllByName(InetAddress.java:1126)
      at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
      at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
      at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at org.apache.http.client.HttpClient$execute$0.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
      at io.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder.doRequest(RequestSpecificationImpl.groovy:2035)
      at io.restassured.internal.http.HTTPBuilder.post(HTTPBuilder.java:349)
      at io.restassured.internal.http.HTTPBuilder$post$2.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
      at io.restassured.internal.RequestSpecificationImpl.sendRequest(RequestSpecificationImpl.groovy:1209)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
      at io.restassured.internal.RequestSpecificationImpl.invokeMethod(RequestSpecificationImpl.groovy)
      at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:149)
      at io.restassured.internal.filter.SendRequestFilter.filter(SendRequestFilter.groovy:30)
      at io.restassured.filter.Filter$filter$0.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at io.restassured.filter.Filter$filter.call(Unknown Source)
      at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72)
      at io.restassured.filter.time.TimingFilter.filter(TimingFilter.java:56)
      at io.restassured.filter.Filter$filter.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at io.restassured.filter.Filter$filter.call(Unknown Source)
      at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72)
      at com.akamai.edgegrid.signer.restassured.RestAssuredEdgeGridFilter.filter(RestAssuredEdgeGridFilter.java:84)
      at io.restassured.filter.Filter$filter.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
      at io.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:72)
      at io.restassured.filter.FilterContext$next.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
      at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1638)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
      at io.restassured.internal.RequestSpecificationImpl.invokeMethod(RequestSpecificationImpl.groovy)
      at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
      at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
      at io.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1644)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1212)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
      at io.restassured.internal.RequestSpecificationImpl.invokeMethod(RequestSpecificationImpl.groovy)
      at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
      at org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
      at io.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy:171)
      at io.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy)
      at framework.Akamai.purgeWithCPCode(Akamai.java:70)
      at tests.FunctionalTest.beforeSuite(FunctionalTest.java:444)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
      at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:401)
      at org.testng.SuiteRunner.run(SuiteRunner.java:364)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
      at org.testng.TestNG.runSuites(TestNG.java:1049)
      at org.testng.TestNG.run(TestNG.java:1017)
      at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
      at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
  </code></pre>
  
  <p>Thanks!
  Greg</p>