App Proxy is changing POST calls into GET calls

Solved
Highlighted
Excursionist
20 1 1

Hi there,

 

I'm facing a very strange problem at this moment with the App Proxy for my public Shopify app.

I have several stores which have my public app installed. A third party is sending POST webhooks to the app to update some data. But for some stores, this POST call was changed into a GET call.


App Proxy setup:

- Subpath prefix: apps

- Subpath: webhooks

- Proxy URL: https://mywebsite.com/webhooks

 

So when I POST call "https://shop.myshopify.com/apps/webhooks/magic-trick" with some payload, I receive a GET call instead for some specific stores...
I have no clue what's wrong.

Both POST and GET have shop, path_prefix, timestamp and signature set and came clearly via the App Proxy.

Please reach out to me if you need more details.

1 Like
Highlighted
Shopify Expert
4182 29 402

Hi,

 

You are in charge here, not Shopify. If you set up a POST callback in your front-end, you will get a POST call to your App. Expect it. If you set up a GET call in your front-end, your back-end App will receive a GET. Except it. 

 

Shopify could care a less what call you make, it is up to you.

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Tourist
5 1 1

This is an accepted solution.

Hi,

 

If you make a POST to the myshopify.com subdomain, and a redirect to the primary domain is active. This might change the POST to a GET.

 

Try POSTing to the primary domain.

 

Best regards,

Jonathan

1 Like
Highlighted
Excursionist
20 1 1

Yeah, this is correct.

When the url is taking you to an App Proxy, you have to make sure that the primary domain is used.

 

Thanks @JonathanEsign !

0 Likes
Highlighted
Shopify Expert
4182 29 402

The pattern of use is to make callbacks to a relative resource, as in:

 

/tools/thing

/a/thing?id=123

/community/thing?shoe=fatty&**bleep**=green

 

Note that there is zero need to involve any domains. It is a PROXY! Shopify knows what to do to the calls. If you include the domain in your front-end, you're doing something wrong, and the results will likely be less than stellar.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes