summaryrefslogtreecommitdiffstats
path: root/archives/extend/attachments/20141014/d89bced6/attachment.html
blob: fc1c75135e0ae09ed4db63dd08fb116f1c8c265b (plain) (blame)
1
2
3
4
5
6
<tt>
&lt;div&nbsp;dir=&quot;ltr&quot;&gt;Hey,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;just&nbsp;subscribed&nbsp;yesterday&nbsp;and&nbsp;now&nbsp;that&#39;s&nbsp;already&nbsp;my&nbsp;first&nbsp;question.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&#39;m&nbsp;referring&nbsp;to &lt;a&nbsp;href=&quot;http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/&quot;&gt;http://ninenines.eu/docs/en/cowboy/1.0/guide/rest_flowcharts/&lt;/a&gt;.&nbsp;Given&nbsp;you&nbsp;have&nbsp;a&nbsp;PUT&nbsp;on&nbsp;a&nbsp;new&nbsp;resource&nbsp;the&nbsp;diagram&nbsp;suggests&nbsp;that&nbsp;the&nbsp;response&#39;s&nbsp;status&nbsp;code&nbsp;depends&nbsp;on&nbsp;whether&nbsp;you&#39;ve&nbsp;set&nbsp;a&nbsp;location&nbsp;and/or&nbsp;body.&nbsp;But&nbsp;when&nbsp;looking&nbsp;at&nbsp;the&nbsp;code&nbsp;(v1.0.0)&nbsp;then&nbsp;cowboy_rest:maybe_created/2&nbsp;would&nbsp;always&nbsp;return&nbsp;a&nbsp;201.&nbsp;No&nbsp;matter&nbsp;what.&nbsp;I&nbsp;think&nbsp;the&nbsp;code&nbsp;is&nbsp;right,&nbsp;but&nbsp;the&nbsp;diagram&nbsp;needs&nbsp;to&nbsp;be&nbsp;fixed. &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But&nbsp;then&nbsp;I&#39;m&nbsp;not&nbsp;totally&nbsp;sure&nbsp;how&nbsp;to&nbsp;interpret &lt;a&nbsp;href=&quot;http://tools.ietf.org/html/rfc2616#section-10.2.2&quot;&gt;http://tools.ietf.org/html/rfc2616#section-10.2.2&lt;/a&gt; which&nbsp;states&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&nbsp;&nbsp;&nbsp;The&nbsp;newly&nbsp;created&nbsp;resource&nbsp;can&nbsp;be&nbsp;referenced&nbsp;by&nbsp;the&nbsp;URI(s)<br>
&nbsp;&nbsp;&nbsp;returned&nbsp;in&nbsp;the&nbsp;entity&nbsp;of&nbsp;the&nbsp;response,&nbsp;with&nbsp;the&nbsp;most&nbsp;specific&nbsp;URI<br>
&nbsp;&nbsp;&nbsp;for&nbsp;the&nbsp;resource&nbsp;given&nbsp;by&nbsp;a&nbsp;Location&nbsp;header&nbsp;field.&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;br&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;span&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em&quot;&gt;Because&nbsp;currently&nbsp;it&nbsp;is&nbsp;totally&nbsp;possible&nbsp;to&nbsp;not&nbsp;have&nbsp;a&nbsp;location&nbsp;header&nbsp;set&nbsp;(just&nbsp;as&nbsp;no&nbsp;body)&nbsp;for&nbsp;the&nbsp;response.&nbsp;In&nbsp;my&nbsp;opinion&nbsp;the&nbsp;current&nbsp;code&nbsp;behaves&nbsp;good&nbsp;enough&nbsp;and&nbsp;it&#39;s&nbsp;up&nbsp;to&nbsp;the&nbsp;service&nbsp;to&nbsp;ensure&nbsp;the&nbsp;requirements&nbsp;as&nbsp;stated&nbsp;by&nbsp;the&nbsp;RFC.&nbsp;Should&nbsp;cowboy&nbsp;enforce&nbsp;a&nbsp;header&nbsp;field?&nbsp;Should&nbsp;it&nbsp;try&nbsp;to&nbsp;figure&nbsp;that&nbsp;out&nbsp;on&nbsp;its&nbsp;own?&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;span&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;span&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em&quot;&gt;Regards,&lt;/span&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;span&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;span&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal;font-size:1em&quot;&gt;Stefan&lt;/span&gt;&lt;/pre&gt;&lt;pre&nbsp;class=&quot;&quot;&nbsp;style=&quot;font-size:1em;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)&quot;&gt;&lt;div&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div&nbsp;style=&quot;color:rgb(34,34,34);font-family:arial;white-space:normal&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;<br>

</tt>