title: Powershell Invoke RestMethod error 415 Unsupported Media Type
body: <p>I'm trying to execute <code>Azure Table Storage API</code> using Powershell <code>Invoke-RestMethod</code> but it returns <strong>415 error</strong>.</p>
  
  <p>Here's Powershell code:</p>
  
  <pre><code>$accessKey = "accesskey"
  $account_name = "storage account"
  $table_name = "table storage"
  $date = "Fri, 10 Nov 2017 00:47:55 GMT"
  $api_version = "2015-12-11"
  $table_url = "https://$account_name.table.core.windows.net/$table_name"
  $data_type = "application/json"
  $signature = "generated signature"
  $body = @{
  Address="Mountain View";
  Age="23"
  }
  $json = $body | Convertto-JSON
  $table_headers = @{
  "x-ms-date" = $date
  "x-ms-version" = $api_version
  "Authorization" = "SharedKey $account_name`:$signature"
  "Content-Type" = $data_type
  }
  
  Invoke-RestMethod -Method POST -Uri $table_url -Headers $table_headers -Body $json -Verbose
  </code></pre>
  
  <p>Remote server retunrned error:</p>
  
  <blockquote>
    <p>詳細: GET
    <a href="https://preprodtelemaapim.management.azure-api.net/reports/byApi?api-version=2017-03-01&amp;" rel="noreferrer">https://preprodtelemaapim.management.azure-api.net/reports/byApi?api-version=2017-03-01&amp;</a>$filter=timestamp+ge+datetime'2017-10-16T00:00:00'+and+timestamp+le+datetime'2017-10-17T00:00:00'
    with 0-byte payload 詳細: received 4841-byte response of content type
    application/json; charset=utf-8 詳細: POST
    <a href="https://telemaapimlog.table.core.windows.net/reporttable" rel="noreferrer">https://telemaapimlog.table.core.windows.net/reporttable</a> with -1-byte
    payload Invoke-RestMethod : リモート サーバーがエラーを返しました*: (415) Unsupported
    Media Type 発生場所 C:\Users\sasaki.hikaru\Desktop\repot.ps1:83 文字:1
    + Invoke-RestMethod -Method POST -Uri $table_url -Headers $table_headers -Body $js ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest)
    [Invoke-RestMethod]、WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand</p>
  </blockquote>
  
  <p>I have read some similar problems in this site but they are no content-type or json description issues mostly so I assume that there are no problems in my code.</p>
  
  <p>Anybody have ideas? Please help me.</p>