Base solution for your next web application
Open Closed

REST API POST,PUT,GET specification #86


User avatar
0
bvz created

When the ApplicationService implementations are exposed as a REST service, how is determined if they should be POST, PUT or GET etc?

Can I override this somehoe? If I want updates to be PUT, and inserts to be POST, how do I tell ABP to expose them the way I want to when generating the REST api?

Thank you.


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Currently, it only implements POST properly. Others on the road. I can not say time but it will be in near future (planned in v0.7.0). The problem about other verbs, Web API does not bind models as same as post. For example, if we use Delete verb, we can only send Ids. I had'nt spend much time to find a proper way.

    Follow <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/142">https://github.com/aspnetboilerplate/as ... issues/142</a> and <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/143">https://github.com/aspnetboilerplate/as ... issues/143</a>.

    Also, you can create regular web API Controllers as you can do without ABP if you fully support REST.

  • User Avatar
    0
    bvz created

    POST works fine for now.

    But how does it know how to make it GET and when to make it POST?

  • User Avatar
    0
    hikalkan created
    Support Team

    Now, everything is POST for dynamic web api layer. When we implement GET/DELETE... there will be configuration and optionally convention (say that if a method name starts with Get, it will be Get...).