diff options
Diffstat (limited to 'src/tool_helpers.c')
-rw-r--r-- | src/tool_helpers.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tool_helpers.c b/src/tool_helpers.c index 2f74dc133..f17d09f50 100644 --- a/src/tool_helpers.c +++ b/src/tool_helpers.c @@ -89,3 +89,26 @@ int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store) return 1; } + +void customrequest_helper(struct OperationConfig *config, HttpReq req, + char *method) +{ + /* this mirrors the HttpReq enum in tool_sdecls.h */ + const char *dflt[]= { + "GET", + "GET", + "HEAD", + "POST", + "POST" + }; + + if(curl_strequal(method, dflt[req])) { + notef(config->global, "Unnecessary use of -X or --request, %s is already " + "inferred.\n", dflt[req]); + } + else if(curl_strequal(method, "head")) { + warnf(config->global, + "Setting custom HTTP method to HEAD may not work the way you " + "want.\n"); + } +} |