title: Shopify API - 822 error registering webhook
body: <p>Hi I am trying to register a Shopify webhook like so</p>
  
  <pre class="lang-php prettyprint-override"><code>    /**
       * @param $webHook
       * @return array
       */
      public function registerWebHook($webHook)
      {
          try {
              $request = $this-&gt;request('admin/webhooks.json', [
                  'form_params' =&gt; [
                      'webhook' =&gt; [
                          'topic' =&gt; $webHook,
                          'address' =&gt; trim(config('app.url'), '/') . '/webhooks',
                          'format' =&gt; 'json'
                      ]
                  ]
              ], 'post');
          } catch(BadResponseException $e) {
              dd($e-&gt;getResponse()-&gt;getBody()-&gt;getContents());
          }
  
          return $this-&gt;parseResponseBody($request);
      }
  </code></pre>
  
  <p>The underlying code sets the access token headers and so on which all works fine with every other request, its just this one that returns the following error;</p>
  
  <pre><code>{"error":"822: unexpected token at 'webhook%5Btopic%5D=products%2Fupdate\u0026webhook%5Baddress%5D=https%3A%2F%2F51t7e3cb.ngrok.io%2Fwebhooks\u0026webhook%5Bformat%5D=json'"}
  </code></pre>
  
  <p>Any help is appreciated. </p>
  
  <p><strong>Edit</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>    /**
       * @param string $endpoint
       * @param array $payload
       * @param string $method
       * @return \Psr\Http\Message\ResponseInterface
       */
      public function request($endpoint = '', $payload = [], $method = 'get')
      {
          $payload['headers'] = [
              'X-Shopify-Access-Token' =&gt; session()-&gt;get('access_data')['access_token'],
              'Content-Type' =&gt; 'application/json'
          ];
  
          $client = new \GuzzleHttp\Client();
          $url = sprintf(
              'https://%s/%s',
              env('SHOPIFY_SHOP_DOMAIN'),
              $endpoint
          );
  
          $response = $client-&gt;{$method}($url, $payload);
          if($response-&gt;getStatusCode() == 200) {
              return $response;
          }
      }
  </code></pre>