About status code 202 and the put method

Igor Sysoev igor at sysoev.ru
Mon Jun 7 17:15:15 MSD 2010


On Mon, Jun 07, 2010 at 09:01:57AM +0800, jyf832004 wrote:

> Hi,all:
> I have two questions:first,I want to use status code 202,but I find that it is null string.Can it set by modifying the source codes or some other ways?

The attached patch adds 202 code.

> second:I want to use the put method with the content length of 0,but nginx doesn't allow it with length required.  

You should set "Content-Length: 0"


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_request.h
===================================================================
--- src/http/ngx_http_request.h	(revision 2922)
+++ src/http/ngx_http_request.h	(working copy)
@@ -64,6 +64,7 @@
 
 #define NGX_HTTP_OK                        200
 #define NGX_HTTP_CREATED                   201
+#define NGX_HTTP_ACCEPTED                  202
 #define NGX_HTTP_NO_CONTENT                204
 #define NGX_HTTP_PARTIAL_CONTENT           206
 
Index: src/http/ngx_http_header_filter_module.c
===================================================================
--- src/http/ngx_http_header_filter_module.c	(revision 2922)
+++ src/http/ngx_http_header_filter_module.c	(working copy)
@@ -53,7 +53,7 @@
 
     ngx_string("200 OK"),
     ngx_string("201 Created"),
-    ngx_null_string,  /* "202 Accepted" */
+    ngx_string("202 Accepted"),
     ngx_null_string,  /* "203 Non-Authoritative Information" */
     ngx_string("204 No Content"),
     ngx_null_string,  /* "205 Reset Content" */


More information about the nginx-devel mailing list