Changes between Version 2 and Version 3 of Ticket #33780


Ignore:
Timestamp:
Jun 13, 2022, 4:56:51 AM (23 months ago)
Author:
Mariusz Felisiak
Comment:

Duplicate of #2784.

Also, you cannot accept your own tickets.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33780

    • Property Triage Stage AcceptedUnreviewed
    • Property Version dev4.0
    • Property Component UncategorizedCore (URLs)
    • Property Resolutionduplicate
    • Property Status newclosed
    • Property Summary FEATURE: add http method argument to the URLResolverAdd http method argument to the URLResolver
  • Ticket #33780 – Description

    v2 v3  
    1010I think, the motivation is clear: the endpoint is actually path + http method. If we look at the swagger page of any API, that becomes clear. In the REST specification, for example, listing the items and creating new item have the same URL. Semantically - quite different things. 
    1111
    12 Other frameworks, like Sanic or FastAPI, already support direct routing by http method (you can decorate the view with @app.get(your_url)). So does Pyramid.
     12Other frameworks, like Sanic or FastAPI, already support direct routing by http method (you can decorate the view with @app.get(your_url), so does Pyramid).
    1313
    1414Moreover, in the mixed wsgi + asgi application, I might want to make creating an item an async view (because the user should be notified about this event), and showing the list of item - a regular sync view. I am not able to do this currently.
     
    2828In the end, I want to stress that there is NO DOWNSIDE of this whatsoever. It's not hard to make resolver.resolve(path) behave as it used to, when the method is not specified. All classes / instances remain the same so there will be no problems with third-party libs like rest_framework, swagger generators or others.
    2929
    30 Personally I am ready to contribute to this feature.
     30Personally I am ready to contribute to this feature. 
Back to Top