Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How can I submit “amp-state” to webservice that I call on “action-xhr”?

How can I submit "amp-state" to PHP webservice that I call on "action-xhr" ?

UPDATE: Let me be specific: I have:

<form method="post" action-xhr="some_web_service_url">
   <amp-state id="myState">
        <script type="application/json">
        {
            "foo": "bar"
        }
        </script>
  </amp-state>
.....
</form>

Now, how can I set foo from the amp-state as one of the arguments/values that I have in my "post" request to "some_web_service_url"? I need to pick the value from the amp-state and I cannot set it to be fixed! I cannot set it in the url query string!

Comments