<div dir="ltr">I believe you are talking about the behavior of swift command ( python-swiftclient) rather than the swift server process itself.<div><br></div><div>1. Swift proxy server process ( in turn container process) handles PUT and POST verbs separately </div>

<div>i.e if you use apis directly,e.g.  via curl or python libraries, there will be no logic of doing a POST first and PUT next.</div><div><br></div><div>2. swift command line ( python-swiftclient) provides an abstracted way to do things..</div>

<div>in fact it has a single command to post any kind of resource (container/object)  and to further ease the effort on user to create</div><div>container separately and update it, its providing an unified interface. its just usability choice the devs had chosen i believe.</div>

<div>May be one of authors can comment more on it.</div><div><br></div><div>--</div><div>Keshava</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 11:04 AM, Ashish Chandra <span dir="ltr"><<a href="mailto:mail.ashishchandra@gmail.com" target="_blank">mail.ashishchandra@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br><div>While creating a new container in Swift, it first tries to do a POST operation thinking it is for updating the metadata, once it get 404 response(container doesnot exists) then it goes for creation of container (PUT request).</div>


<div><br></div><div>I feel like its a two way process, making two different HTTP calls one after the another. Instead what could have been done, we could have simply used PUT verb after checking the parameters(header dict will be empty if a user wants to create a container).</div>


<div><br></div><div>I want to know is there is a specific design decision behind this.</div><div><div><br></div>-- <br><div dir="ltr"><pre>    .- <O> -.        .-====-.      ,-------.      .-=<>=-.
   /_-\'''/-_\      / / '' \ \     |,-----.|     /__----__\
  |/  o) (o  \|    | | ')(' | |   /,'-----'.\   |/ (')(') \|
   \   ._.   /      \ \    / /   {_/(') (')\_}   \   __   /
   ,>-_,,,_-<.       >'=jf='<     `.   _   .'    ,'--__--'.
 /      .      \    /        \     /'-___-'\    /    :|    \
(_)     .     (_)  /          \   /         \  (_)   :|   (_)
 \_-----'____--/  (_)        (_) (_)_______(_)   |___:|____|
  \___________/     |________|     \_______/     |_________|</pre><pre><br></pre><pre>Thanks and Regards</pre><pre>Ashish Chandra</pre><pre>Openstack Developer, Cloud Engineering</pre><pre>Reliance Jio</pre></div>
</div></div></div>
<br>_______________________________________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>
<br></blockquote></div><br></div>