Jump to content

Pw Supports Http Verbs (Get, Post, Put, Delete)?


clsource
 Share

Recommended Posts

Hello,

I´m trying to make a REST API with PW.

is there something like $wire('input')->get and $wire('input')->post

but for the verbs delete and put?

also how can I separate the code for each verb.

example:

I have the following endpoint 

/users/emails

Processwire can detect what verb is beign used to call that endpoint? (automatically call the corresponding code paired with the verb)

or I have to manually check it and execute the corresponding code, using an if or something similar.

basically I am looking for a router like Lime

https://github.com/aheinze/Lime

If PW does not have a router, 
using wire('pages') inside Lime it´s possible without conflicts?

Thanks.

Link to comment
Share on other sites

  • 9 years later...

Leaving this update here, for the future:
 

Quote

In addition, the WireHttp class was updated with new delete(), patch() and put() methods which correspond to http methods of the same name, These might be used by web services in addition to the more common GET and POST methods. In prior versions of WireHttp, you could still use delete, patch and put methods, but had to use WireHttp::send() with the $method argument set to one of them.

 

  • Like 3
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...