App proxy doesn't send a request as it should

Highlighted
New Member
4 0 0

Hello, I'm trying to send product id to my server and display the returned html info  using jquery. 

My app proxy info:

Sub path prefix: apps

Sub path: reviews

Proxy URL: https://example.mysite.com/test/public/action

Simple jquery code for testing

   

<div id="az_reviews" class="az_reviews">

<script>

   $(document).ready(function(){

            $.ajax({
                url: '/apps/reviews/action',
                type: 'POST',
                data: {product_id: 5},

                success: function (data) {
                    $('#az_reviews').html(data);

                }
            });
});
    </script>

I tryied to send data to  

1- "/apps/reviews/action"

2- "/apps/reviews"

but neither one worked 

 

How can I send request to my server thorugh app proxy? 

Whats I'm doing wrong ? 

 

0 Likes
Highlighted
New Member
4 0 0

No one ?? Please help 

0 Likes
Highlighted
Shopify Partner
40 0 4

I'm having the same problem. Are POST requests not allowed?

0 Likes
Highlighted
Shopify Partner
3 0 1

I am facing same problem, it seems that POST method is not allowed on app proxy.

HTTP 405 Method not AllowedHTTP 405 Method not Allowed

There is an alternative to this?

0 Likes
Highlighted
Shopify Expert
4182 29 403

You can do POST or GET. It is your choice. The App Proxy does not care. It is simply a wrapper and forwards requests to your App end point.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
1 Like
Highlighted
Shopify Partner
3 0 1

You are right, I can POST to an App Proxy, it was my mistake.

1 Like