@@ -177,9 +177,11 @@ extern void ngx_http_c_func_write_resp(
177
177
uintptr_t status_code,
178
178
const char* status_line,
179
179
const char* content_type,
180
- const char* resp_content
180
+ const char* resp_content,
181
+ size_t resp_len
181
182
);
182
183
184
+
183
185
// Shared Memory and Cache Scope
184
186
extern void ngx_http_c_func_shmtx_lock (void * shared_mem);
185
187
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
220
222
ctx->req_body;
221
223
```
222
224
225
+ #### get the request body length
226
+ ``` c
227
+ ctx->req_body_len;
228
+ ```
229
+
223
230
#### loggin to nginx server
224
231
``` c
225
232
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(
235
242
uintptr_t status_code, // Status code
236
243
const char* status_line, // Status line
237
244
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
239
247
);
240
248
```
241
249
@@ -319,6 +327,7 @@ void my_app_simple_post(ngx_http_c_func_ctx_t *ctx) {
319
327
202,
320
328
"202 Accepted and Processing",
321
329
"text/plain",
330
+ ctx->req_body,
322
331
ctx->req_body
323
332
);
324
333
}
0 commit comments