title: Signing a request with a hmacSHA25 signature in Postman using a pre-request script for NiceHash API
body: <p>I am trying to sign a request to access the <code>NiceHash API</code>.</p>
  <p>Please see the requirements for signing the request here:
  <a href="https://www.nicehash.com/docs/" rel="nofollow noreferrer">https://www.nicehash.com/docs/</a></p>
  <pre><code>postman.setGlobalVariable(&quot;hmac&quot;, CryptoJS.HmacSHA256(pm.request.headers, 'mySecret'));
  </code></pre>
  <p>Here is what my <code>X-Auth</code> Header looks like:
  X-Auth: my-key:{{hmac}}</p>
  <p>I have a feeling I am not satisfying the input param to the <code>HmacSHA256</code> function. They are saying:</p>
  <blockquote>
  <p>Input is a byte array composed of ordered fields using zero byte
  (0x00) as a separator. There is no separator before the first field or
  after the last field. Some fields are always empty in which case the
  separators immediately follow one another. If converting HTTP header
  values, and url parts from string to byte representation you should
  use ISO-8859-1 encoding. For request body you should use the raw bytes
  as they are sent to the server. For JSON messages the character
  encoding should always be UTF-8.</p>
  </blockquote>
  <p>Any ideas what I am doing wrong? I keep getting a <code>401</code> unauthorized.</p>