Welcome Guest, Not a member yet? Register   Sign In
Phill Sturgeon's REST client POST samples
#1

[eluser]johnnytoobad[/eluser]
I'm just diving into Phil Sturgeon's REST client. I've managed to grab information using GET perfectly now I'm trying to push information using POST. The API I am working with (Shopify) wants data POST as XML. Was looking for some samples to get me going, all the documentation refers to http://philsturgeon.co.uk/restclient/. Unfortunately that page seems to have disappeared.

The sample code I'm trying to POST is this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<product>
  &lt;body-html&gt;Good snowboard!&lt;/body-html&gt;
  <product-type>Snowboard</product-type>
  &lt;title&gt;Burton Custom Freestlye 151&lt;/title&gt;
  <images type="array">
    <image>
      <src>http://example.com/rails_logo.gif</src>
    </image>
  </images>
  <vendor>Burton</vendor>
</product>

I know I need to use $this->rest->post();, can anyone point me in the direction of a sample of how to pass XML like this using the rest->post() function? Thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB