title: Powershell v3 Invoke-RestMethod Headers
body: <p>I am trying to make a RestAPI call to a service which specifies in it's documentation the following:</p>
  
  <blockquote>
    <p>An Integration Server can respond in XML and JSON formats. Use one of the following accept headers in your
    requests:</p>
    
    <ol>
    <li>accept: application/json, <em>/</em>.</li>
    <li>accept: application/xml, <em>/</em></li>
    </ol>
    
    <p>If the accept header does not include application/xml, application/json or <em>/</em>, the integration server will respond with a "406 method not acceptable" status code.</p>
  </blockquote>
  
  <p>My powershell code looks like this
  <code>Invoke-RestMethod -URI https://URL/ticket -Credential $cred -Method Get -Headers @{"Accept"="application/xml"}</code></p>
  
  <p>But I get the following error relating to the header:
  <code>Invoke-RestMethod : This header must be modified using the appropriate property or method.
  Parameter name: name</code></p>
  
  <p>Can someone assist me with understanding why powershell wont let me specify the Accept header?  Or is there another method I'm missing here?</p>
  
  <p>Thanks</p>