title: I am using Postman, to pass the data to a REST api but my variable is showing null value
body: <p>My main question is how to pass a (Map, String) to a REST API, I know if I use @RequestBody all the passed contents are stored to map but what can be done to pass map as well as any other parameters REST API.</p>
  
  <pre><code>@GetMapping(path="/invoices")
  public String invoiceReceived( Map&lt;String,Object&gt; invoice,String format) throws MessagingException {
          System.out.println(format); // this prints NULL
          return "returnValue";
  }
  </code></pre>
  
  <p>So I tried using PathVariable but they throw exception. What can be done?</p>
  
  <pre><code>@GetMapping(path="/invoices/{invoiceData}/{format}")
  public String invoiceReceived(@PathVariable("invoiceData") Map&lt;String,Object&gt; invoice, 
  @PathVariable("format") String format) throws MessagingException {
          System.out.println(format); // this prints NULL
          return "returnValue";
  }
  </code></pre>
  
  <p>What should I do to accept a map and a variable as input? And what should be the JSON file look like which should be given as input?</p>
  
  <pre><code>   {
          "invoiceData":[{"invoiceId":"23642",
          "clientName":"Client",
          "amount":"23742.67",
          "email":"client@abc.com"
          }],
          "format":"html"
      }
  </code></pre>
  
  <p>This question was identified similar to another question, So I am trying to explain how is this different, I know that I can use @RequestBody to get all the variables in the map, but The call will be made with two parameters some of which will be stored in map but one parameter will be used for another variable. So how can I send a map along with any other variable?</p>