Open Closed

REST API POST,PUT,GET specification #86


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)
  • 0
    hikalkan created

    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 https://github.com/aspnetboilerplate/as ... issues/142 and https://github.com/aspnetboilerplate/as ... issues/143.

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

  • 0
    bvz created

    POST works fine for now.

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

  • 0
    hikalkan created

    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...).