diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-22 02:50:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-22 02:51:35 +0200 |
commit | e621e6cac6dd99e069be9de694c2f9d33357a27d (patch) | |
tree | 252dbe4dc384fdaa25e1a27b2174f68d2e64ff7e | |
parent | dac096cf39d24735f1992b7d867519f17974865b (diff) | |
parent | 28df1d24112c6ad0763985df2faeeb198cfbad69 (diff) | |
download | ffmpeg-e621e6cac6dd99e069be9de694c2f9d33357a27d.tar.gz |
Merge commit '28df1d24112c6ad0763985df2faeeb198cfbad69'
* commit '28df1d24112c6ad0763985df2faeeb198cfbad69':
http: Provide an option to override the HTTP method
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/http.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 3e172e3645..75845ab67f 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -89,6 +89,7 @@ typedef struct { #endif AVDictionary *chained_options; int send_expect_100; + char *method; } HTTPContext; #define OFFSET(x) offsetof(HTTPContext, x) @@ -116,6 +117,7 @@ static const AVOption options[] = { {"location", "The actual location of the data received", OFFSET(location), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E }, {"offset", "initial byte offset", OFFSET(off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D }, {"end_offset", "try to limit the request to bytes preceding this offset", OFFSET(end_off), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, D }, +{"method", "Override the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E, }, {NULL} }; #define HTTP_CLASS(flavor)\ @@ -684,7 +686,11 @@ static int http_connect(URLContext *h, const char *path, const char *local_path, s->chunked_post = 0; } - method = post ? "POST" : "GET"; + if (s->method) + method = s->method; + else + method = post ? "POST" : "GET"; + authstr = ff_http_auth_create_response(&s->auth_state, auth, local_path, method); proxyauthstr = ff_http_auth_create_response(&s->proxy_auth_state, proxyauth, |