Skip to content

Commit 2271a96

Browse files
committed
update readme
1 parent b522d96 commit 2271a96

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,11 @@ extern void ngx_http_c_func_write_resp(
177177
uintptr_t status_code,
178178
const char* status_line,
179179
const char* content_type,
180-
const char* resp_content
180+
const char* resp_content,
181+
size_t resp_len
181182
);
182183

184+
183185
// Shared Memory and Cache Scope
184186
extern void ngx_http_c_func_shmtx_lock(void *shared_mem);
185187
extern void ngx_http_c_func_shmtx_unlock(void *shared_mem);
@@ -220,6 +222,11 @@ extern void* ngx_http_c_func_get_query_param(ngx_http_c_func_ctx_t *ctx, const c
220222
ctx->req_body;
221223
```
222224

225+
#### get the request body length
226+
```c
227+
ctx->req_body_len;
228+
```
229+
223230
#### loggin to nginx server
224231
```c
225232
extern void ngx_http_c_func_log_debug(ngx_http_c_func_ctx_t *ctx, const char* msg);
@@ -235,7 +242,8 @@ extern void ngx_http_c_func_write_resp(
235242
uintptr_t status_code, // Status code
236243
const char* status_line, // Status line
237244
const char* content_type, // Response content type
238-
const char* resp_content // Response content
245+
const char* resp_content, // Response content
246+
size_t resp_len // Response content length
239247
);
240248
```
241249

@@ -319,6 +327,7 @@ void my_app_simple_post(ngx_http_c_func_ctx_t *ctx) {
319327
202,
320328
"202 Accepted and Processing",
321329
"text/plain",
330+
ctx->req_body,
322331
ctx->req_body
323332
);
324333
}

0 commit comments

Comments
 (0)