summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55f8f71)
raw | patch | inline | side by side (parent: 55f8f71)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Fri, 20 Feb 2004 03:21:40 +0000 (03:21 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Fri, 20 Feb 2004 03:21:40 +0000 (03:21 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@813 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_http.c | patch | blob | history |
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 8e45e88d5bec3593cbe15a3ed5fcb483382bc6a9..afd75d3d8125ee6620a006d96f4dbf6d5642439b 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
int max_depth = 15;
char *http_method;
char *http_post_data;
+char *http_content_type;
char buffer[MAX_INPUT_BUFFER];
int process_arguments (int, char **);
{"linespan", no_argument, 0, 'l'},
{"onredirect", required_argument, 0, 'f'},
{"certificate", required_argument, 0, 'C'},
+ {"content-type", required_argument, 0, 'T'},
{"min", required_argument, 0, 'm'},
{"use-ipv4", no_argument, 0, '4'},
{"use-ipv6", no_argument, 0, '6'},
server_expect[MAX_INPUT_BUFFER - 1] = 0;
server_expect_yn = 1;
break;
+ case 'T': /* Content-type */
+ asprintf (&http_content_type, "%s", optarg);
+ break;
#ifndef HAVE_REGEX_H
case 'l': /* linespan */
case 'r': /* linespan */
/* either send http POST data */
if (http_post_data) {
- asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf);
+ if (http_content_type) {
+ asprintf (&buf, "%sContent-Type: %s\r\n", buf, http_content_type);
+ } else {
+ asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf);
+ }
asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data));
asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF);
}
-u, --url=PATH\n\
URL to GET or POST (default: /)\n\
-P, --post=STRING\n\
- URL encoded http POST data\n"), HTTP_EXPECT);
+ URL encoded http POST data\n\
+ -T, --content-type=STRING\n\
+ specify Content-Type header media type when POSTing\n"), HTTP_EXPECT);
#ifdef HAVE_REGEX_H
printf (_("\