title: How to pass basic authentication as part of request header in RestAssured?
body: <p>I am new to API testing and RestAssured. I have been trying to access the API (protected by basic authentication) <a href="http://restapi.demoqa.com/authentication/CheckForAuthentication" rel="nofollow noreferrer">http://restapi.demoqa.com/authentication/CheckForAuthentication</a> through RestAssured but do not know how to do it. </p>
  
  <p>Here is the code I have written so far:</p>
  
  <pre><code>import io.restassured.RestAssured;
  import io.restassured.response.Response;
  import io.restassured.specification.RequestSpecification;
  
  RestAssured.baseURI = "http://restapi.demoqa.com/authentication/CheckForAuthentication";
  RequestSpecification request = RestAssured.given();
  
  **I guess authentication code goes here but not sure**
  Response response = request.get();
  </code></pre>