POST request is responding as GET

Solved
Highlighted
Shopify Partner
7 1 0

Hi,

 

We have an ERP which exports products to Shopify store using the Product REST API. Always worked correctly, but on a specific client POST requests are responding as GET.

When I try to create a product I receive the products that were already registered. I should receive a JSON with the registered product.

This happens in just one customer's store.

 

Could anyone help?

 

Thanks in advance.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
463 93 80

Can you post the request you are sending to Shopify along with the request ID (found in the response header) Thanks!

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


1 Like
Highlighted
Shopify Partner
7 1 0

Hi,

 

X-Request-Id: d4d9f41d-8ed0-4dd7-9e3d-747649c0add4

Request:

Method: POST, RequestUri: 'https://du-ponto-moda-intima.myshopify.com/admin/api/2019-10/products.json', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
{
X-Shopify-Access-Token: XXX
Content-Type: application/json; charset=utf-8
Content-Length: 1161
}}

 

Response:

{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
Connection: keep-alive
X-Sorting-Hat-PodId: 156
X-Sorting-Hat-ShopId: 34063188100
Vary: Accept-Encoding
Referrer-Policy: origin-when-cross-origin
X-Frame-Options: DENY
X-ShopId: 34063188100
X-ShardId: 156
X-Stats-UserId:
X-Stats-ApiClientId: 3203783
X-Stats-ApiPermissionId: 260747493533
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Shopify-Shop-Api-Call-Limit: 1/40
X-Shopify-API-Version: 2019-10
Strict-Transport-Security: max-age=7889238
X-Request-Id: d4d9f41d-8ed0-4dd7-9e3d-747649c0add4
X-Shopify-Stage: production
Content-Security-Policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=d4d9f41d-8ed0-4dd7-9e3d-747649c0add4
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=d4d9f41d-8ed0-4dd7-9e3d-747649c0add4
X-Dc: gcp-us-east1,gcp-us-east1
NEL: {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001}
Report-To: {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]}
CF-Cache-Status: DYNAMIC
cf-request-id: 03cbc7f4020000f66f622e3200000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
CF-RAY: 5af30f666b0ff66f-GRU
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
Date: Tue, 07 Jul 2020 16:49:41 GMT
Server: cloudflare
Content-Type: application/json; charset=utf-8
}}

0 Likes
Highlighted
Shopify Partner
7 1 0

This is an accepted solution.

Hey, I just found out what was going wrong.

 

Basically I was doing the POST using the primary domain, but when I changed to use the shopify domain (store.myshopify.com) everything worked as a charm.

 

Thank you anyway.

0 Likes