Jump to content

Rest Helper For Processwire


clsource

Recommended Posts

@IntegralHack

You can find the code to get you started towards the end of post #10 in this thread.

Of course, you would need to define your classes (in the example the classes are in /models/Product.php) that have the actual code for  getting, putting, posting and deleting values.

If you need to see some more code, PM me.


In the way I learned new tricks and Processwire also have many new things that could improve the rest helper.

It would be much appreciated if you could share some of the tricks and what the new things in PW are that you are talking about :)

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Is there a way to get parameters from patch, put, and delete? Rest\Request::params() doesn't seem to work with these verbs?

I can confirm, that put is working. All JSON that I send in the request body is available in $params.

For patch/delete, I'm sorry, but I don't know because I haven't used them.

If $params is empty: did you make sure that header Content-Type application/json is set? Or maybe the JSON in your request body is malformed?

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...
On 9/9/2016 at 2:48 PM, krisj said:

Has anyone tried to use this to connect PW to something like Zapier?
I am trying to put aside some time to try it out, should work.

nice work @clsource !

It just a Rest Helper

So technically will be compatible with Zapier

but only if you create the endpoints and json responses

for your system.

It´s not intended to, for example, a Rest Wrapper to PW
that works like the admin page, but with a rest way of creating pages, templates and so on.

:)

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...