title: How to get the access token of REST API endpoint using Rest Assured with POST method, Currently I am getting 404 error?
body: <p>I am trying to run  POST method to get the access token using REST Assured Code. But it is returning  404 error. My code is as below. 
  POSTMAN Configuration as below same  trying to replicate using Rest Assured</p>
  
  <pre><code>Method : POST
  
  Authorization tab: 
               Type : Basic Auth 
               UserName :  ABCD
               Passsowrd : Test@1234
  
  Body Tab : 
             Selecting  "application/x-www-form-urlencode" Radio Button
             Key : grant_type  Value : Client_Credentials
             Key : Scope       value : ABCDAPI
  
  
  given().auth().basic("Username Here","Password type here")
  .header("Authorization", "Basic T1VUUkVBQ0hfQVBJX0NMSUVOVDpIWmRwREwydkR5UE5iQmtvWEdxSkFpK1Qxa08yWSszNndxQXhoYTVXUWhZPQ==n")
  .header("Content-Type","application/x-www-form-urlencoded")         
  .contentType("application/x-www-form-urlencoded")
  .body("[{\"grant_type\":\"client_credentials\"}]")
  .body("[{\"scope\":\"ABCDpi\"}]").when()            
  .post("https://ABCD.KLM.id.XYZ-Cloud.net/oauth2/access_token?realm=PQR")            
  .then().contentType("").statusCode(200);
  </code></pre>
  
  <p>I am also attaching the screenshot of Postman where it is working <a href="https://i.stack.imgur.com/1Hsy6.jpg" rel="nofollow noreferrer">enter image description here</a></p>