CreateRequest() public method

Create a new HTTP request.
public CreateRequest ( HTTPMethod HTTPMethod, String URI, Action BuilderAction = null ) : HTTPRequestBuilder
HTTPMethod HTTPMethod A HTTP method.
URI String An URI.
BuilderAction Action A delegate to configure the new HTTP request builder.
return HTTPRequestBuilder
Esempio n. 1
0
 /// <summary>
 /// Create a new HTTP POST request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <param name="BuilderAction">A delegate to configure the new HTTP request builder.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder POST(this HTTPClient HTTPClient,
                                       String URI,
                                       Action <HTTPRequestBuilder> BuilderAction = null)
 {
     return(HTTPClient.
            CreateRequest(HTTPMethod.POST, URI, BuilderAction).
            // Always send a Content-Length header, even when it's value is zero
            SetContentLength(0));
 }
Esempio n. 2
0
        /// <summary>
        /// Create a new HTTP CREATE request.
        /// </summary>
        /// <param name="HTTPClient">A HTTP client.</param>
        /// <param name="URI">An URL path.</param>
        /// <param name="BuilderAction">A delegate to configure the new HTTP request builder.</param>
        /// <returns>A HTTP request object.</returns>
        public static HTTPRequestBuilder CREATE(this HTTPClient HTTPClient,
                                                String URI,
                                                Action <HTTPRequestBuilder> BuilderAction = null)

        => HTTPClient.CreateRequest(HTTPMethod.CREATE, URI, BuilderAction);
Esempio n. 3
0
 /// <summary>
 /// Create a new HTTP DELETE request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <param name="BuilderAction">A delegate to configure the new HTTP request builder.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder DELETE(this HTTPClient HTTPClient,
                                         String URI,
                                         Action <HTTPRequestBuilder> BuilderAction = null)
 {
     return(HTTPClient.CreateRequest(HTTPMethod.DELETE, URI, BuilderAction));
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new HTTP TRAVERSE request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder TRAVERSE(this HTTPClient HTTPClient,
                                           String URI)
 {
     return(HTTPClient.CreateRequest(HTTPMethod.TRAVERSE, URI));
 }
Esempio n. 5
0
 /// <summary>
 /// Create a new HTTP PATCH request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder PATCH(this HTTPClient HTTPClient,
                                        String URI)
 {
     return(HTTPClient.CreateRequest(HTTPMethod.PATCH, URI));
 }
Esempio n. 6
0
 /// <summary>
 /// Create a new HTTP OPTIONS request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder OPTIONS(this HTTPClient HTTPClient,
                                          String URI)
 {
     return(HTTPClient.CreateRequest(HTTPMethod.OPTIONS, URI));
 }
Esempio n. 7
0
 /// <summary>
 /// Create a new HTTP CREATE request.
 /// </summary>
 /// <param name="HTTPClient">A HTTP client.</param>
 /// <param name="URI">An URL path.</param>
 /// <returns>A HTTP request object.</returns>
 public static HTTPRequestBuilder CREATE(this HTTPClient HTTPClient,
                                         String URI)
 {
     return(HTTPClient.CreateRequest(HTTPMethod.CREATE, URI));
 }