Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-08 Thread Alex Xu
Kevin, thanks for the info! I agree with you. RFC is the authority. use
payload in the DELETE isn't good way.

2014-12-09 7:58 GMT+08:00 Kevin L. Mitchell :

> On Tue, 2014-12-09 at 07:38 +0800, Alex Xu wrote:
> > Not sure all, nova is limited
> > at
> https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L79
> > That under our control.
>
> It is, but the client frameworks aren't, and some of them prohibit
> sending a body with a DELETE request.  Further, RFC7231 has this to say
> about DELETE request bodies:
>
> A payload within a DELETE request message has no defined semantics;
> sending a payload body on a DELETE request might cause some
> existing
> implementations to reject the request.
>
> (§4.3.5)
>
> I think we have to conclude that, if we need a request body, we cannot
> use the DELETE method.  We can modify the operation, such as setting a
> "force" flag, with a query parameter on the URI, but a request body
> should be considered out of bounds with respect to DELETE.
>
> > Maybe not just ask question for delete, also for other method.
> >
> > 2014-12-09 1:11 GMT+08:00 Kevin L. Mitchell <
> kevin.mitch...@rackspace.com>:
> > On Mon, 2014-12-08 at 14:07 +0800, Eli Qiao wrote:
> > > I wonder if we can use body in delete, currently , there isn't
> any
> > > case used in v2/v3 api.
> >
> > No, many frameworks raise an error if you try to include a body
> with a
> > DELETE request.
> > --
> > Kevin L. Mitchell 
> > Rackspace
>
> --
> Kevin L. Mitchell 
> Rackspace
>
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-08 Thread Kevin L. Mitchell
On Tue, 2014-12-09 at 07:38 +0800, Alex Xu wrote:
> Not sure all, nova is limited
> at 
> https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L79
> That under our control.

It is, but the client frameworks aren't, and some of them prohibit
sending a body with a DELETE request.  Further, RFC7231 has this to say
about DELETE request bodies:

A payload within a DELETE request message has no defined semantics;
sending a payload body on a DELETE request might cause some existing
implementations to reject the request.

(§4.3.5)

I think we have to conclude that, if we need a request body, we cannot
use the DELETE method.  We can modify the operation, such as setting a
"force" flag, with a query parameter on the URI, but a request body
should be considered out of bounds with respect to DELETE.

> Maybe not just ask question for delete, also for other method.
> 
> 2014-12-09 1:11 GMT+08:00 Kevin L. Mitchell :
> On Mon, 2014-12-08 at 14:07 +0800, Eli Qiao wrote:
> > I wonder if we can use body in delete, currently , there isn't any
> > case used in v2/v3 api.
> 
> No, many frameworks raise an error if you try to include a body with a
> DELETE request.
> --
> Kevin L. Mitchell 
> Rackspace

-- 
Kevin L. Mitchell 
Rackspace


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-08 Thread Alex Xu
Not sure all, nova is limited at
https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L79
That under our control.

Maybe not just ask question for delete, also for other method.

2014-12-09 1:11 GMT+08:00 Kevin L. Mitchell :

> On Mon, 2014-12-08 at 14:07 +0800, Eli Qiao wrote:
> > I wonder if we can use body in delete, currently , there isn't any
> > case used in v2/v3 api.
>
> No, many frameworks raise an error if you try to include a body with a
> DELETE request.
> --
> Kevin L. Mitchell 
> Rackspace
>
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-08 Thread Kevin L. Mitchell
On Mon, 2014-12-08 at 14:07 +0800, Eli Qiao wrote:
> I wonder if we can use body in delete, currently , there isn't any
> case used in v2/v3 api.

No, many frameworks raise an error if you try to include a body with a
DELETE request.
-- 
Kevin L. Mitchell 
Rackspace


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-07 Thread Chen CH Ji
Found something might be helpful for you
http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request



Best Regards!

Kevin (Chen) Ji 纪 晨

Engineer, zVM Development, CSTL
Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jiche...@cn.ibm.com
Phone: +86-10-82454158
Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District,
Beijing 100193, PRC



From:   Eli Qiao 
To: "OpenStack Development Mailing List (not for usage questions)"

Date:   12/08/2014 02:10 PM
Subject:    Re: [openstack-dev] [api] Using query string or request body to
    pass parameter




在 2014年12月08日 13:13, Alex Xu 写道:
  Hi,

  I have question about using query string or request body for REST
  API.
I wonder if we can use body in delete, currently , there isn't any case
used in v2/v3 api.

  This question found when I review this spec:
  
https://review.openstack.org/#/c/131633/6..7/specs/kilo/approved/judge-service-state-when-deleting.rst

  Think about use request body will have more benefit:
  1. Request body can be validated by json-schema
  2. json-schema can doc what can be accepted by the parameter

  Should we have guideline for this?


  ___
  OpenStack-dev mailing list
  OpenStack-dev@lists.openstack.org
  http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


--
Thanks,
Eli (Li Yong) Qiao___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [api] Using query string or request body to pass parameter

2014-12-07 Thread Eli Qiao


在 2014年12月08日 13:13, Alex Xu 写道:

Hi,

I have question about using query string or request body for REST API.
I wonder if we can use body in delete, currently , there isn't any case 
used in v2/v3 api.


This question found when I review this spec:
https://review.openstack.org/#/c/131633/6..7/specs/kilo/approved/judge-service-state-when-deleting.rst

Think about use request body will have more benefit:
1. Request body can be validated by json-schema
2. json-schema can doc what can be accepted by the parameter

Should we have guideline for this?


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


--
Thanks,
Eli (Li Yong) Qiao

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [api] Using query string or request body to pass parameter

2014-12-07 Thread Alex Xu
Hi,

I have question about using query string or request body for REST API.

This question found when I review this spec:
https://review.openstack.org/#/c/131633/6..7/specs/kilo/approved/judge-service-state-when-deleting.rst

Think about use request body will have more benefit:
1. Request body can be validated by json-schema
2. json-schema can doc what can be accepted by the parameter

Should we have guideline for this?
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev