Пример #1
0
 public static IHttpObservable Post(this IHttpClient http, Uri url, HttpContent content) =>
 HttpObservable.Return(ho =>
                       // TODO Use DeferAsync
                       Observable.Defer(() =>
                                        SendAsync(http, ho.Configurer(http.Config), 0, HttpMethod.Post, url, content, ho.Options)
                                        .ToObservable()
                                        .Select(f => f.WithConfig(http.Config.WithCookies(f.Client.Config.Cookies)))));
Пример #2
0
 static IHttpObservable Submit(IObservable <HttpFetch <ParsedHtml> > query, string formSelector, int?formIndex, Uri url, NameValueCollection data) =>
 HttpObservable.Return(
     from html in query
     select Submit(html.Client, html.Content, formSelector, formIndex, url, data));
Пример #3
0
 internal static IHttpObservable Submit(this IObservable <HttpFetch <ParsedHtml> > query, string formSelector, int?formIndex, Uri url, ISubmissionData <Unit> data) =>
 HttpObservable.Return(
     from html in query
     select Submit(html.Client, html.Content, formSelector, formIndex, url, _ => data));
Пример #4
0
 public static IHttpObservable Post(this IHttpObservable query, Uri url, HttpContent content) =>
 HttpObservable.Return(
     from f in query
     select f.Client.Post(url, content));
Пример #5
0
 public static IHttpObservable Post(this IHttpObservable query, Uri url, NameValueCollection data) =>
 HttpObservable.Return(
     from f in query
     select f.Client.Post(url, data));
Пример #6
0
 public static IHttpObservable Get(this IHttpClient http, Uri url) =>
 HttpObservable.Return(ho =>
                       // TODO Use DeferAsync
                       Observable.Defer(() =>
                                        SendAsync(http, ho.Configurer(http.Config), 0, HttpMethod.Get, url, options: ho.Options)
                                        .ToObservable()));
Пример #7
0
 public static IHttpObservable Get(this IHttpObservable query, Uri url) =>
 HttpObservable.Return(
     from first in query
     select first.Client.Get(url));