1

A lot of our SKUs have spaces and forward slashes in them (eg: "PRODUCT1-DARK BLUE" and "PRODUCT2-DARK/RED". I'm able to curl to the products with spaces via url encoding:

    # sample SKU: "PRODUCT1-DARK BLUE"
    # encoded: "PRODUCT1-DARK%20BLUE"
    > curl -X GET -H "Authorization: Bearer" "https://www.magentosite.com/index.php/rest/V1/products/PRODUCT1-Dark%20Blue"
    > returns data successfully

But unfortunately I can't seem to fetch any of our SKUs with the forward slash.  For example:

    # sample SKU: "PRODUCT2-DARK/RED"
    # encoded: "PRODUCT2-Dark%2FRed"
    > curl -X GET -H "Authorization: Bearer" "https://www.magentosite.com/index.php/rest/V1/products/PRODUCT2-Dark%2FRed"
    > returns "The requested URL was not found on this server." error

  I've tried encoding other variations ("PRODUCT2-DARK\/RED", "PRODUCT2-DARK//RED", and "PRODUCT2-DARK/RED") with no luck.  Any other ideas of something I can try?

Outside of changing our SKUs, is still there a way I can still try to GET/POST to our catalog product data containing forward slash characters in their SKU?  I know I can use products?&searchCriteria, however I need to POST and not just GET.

Thank you for any assistance!

1

There was a similar question some years ago, here is the answer , I think it will help you.

2
  • your google-fu skills are far superior to mine, thank you! Mar 31 '21 at 0:10
  • I had similar issue a long time ago, and I remember that someone had answered it. Glad helping you. Mar 31 '21 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.