@@ -34,43 +34,48 @@ public interface HttpRequest {
3434 /**
3535 * Add parameter to the request form (either urlencoded or multipart).
3636 */
37- public HttpRequest addFormParameter (String name , String value );
37+ public HttpRequest addFormPart (String name , String value );
3838
3939 /**
4040 * Add file form parameter with specified content type and file name to the
4141 * reqeust converting it into a multipart form .
4242 */
43- public HttpRequest addFileParameter (String name , File file ,
43+ public HttpRequest addFilePart (String name , File file ,
4444 String contentType , String fileName );
4545
4646 /**
4747 * Add file form parameter to the request converting it into a multipart
4848 * form. Content type will be set to "application/octet-stream" and file
4949 * name to the name of the file.
5050 */
51- public default HttpRequest addFileParameter (String name , File file ) {
51+ public default HttpRequest addFilePart (String name , File file ) {
5252 return addFile (name , file , "application/octet-stream" , file .getName ());
5353 }
5454
5555 /**
5656 * Add file form parameter to the request converting it into a multipart
5757 * form.
5858 */
59- public HttpRequest addFileParameter (String name , InputStream stream ,
59+ public HttpRequest addFilePart (String name , InputStream stream ,
6060 String contentType , String fileName );
6161
6262 /**
6363 * Add file form parameter to the reqeust converting it into a multipart form.
6464 * The content type will be set to "application/octet-stream" and file name to "file".
6565 */
66- public default HttpRequest addFileParameter (String name , InputStream stream ) {
66+ public default HttpRequest addFilePart (String name , InputStream stream ) {
6767 return addFileParameter (name , stream , "application/octet-stream" , "file" )
6868 }
6969
7070 /**
71- * Remove all parameters having the specified name from the reuqest .
71+ * Remove all query parameters having the specified name from the request .
7272 */
73- public HttpRequest clearParameter (String name );
73+ public HttpRequest clearQueryParameters (String name );
74+
75+ /**
76+ * Remove all form parameters having the specified name.
77+ */
78+ public HttpRequest clearFormParts (String name );
7479
7580 /**
7681 * Send the request to the server and return the response.
@@ -125,33 +130,32 @@ public default void close() throws IOException {
125130 }
126131
127132 /**
128- * Initialises the GET request builder. Usually they have no request body and
133+ * Creates a new GET request. They usually have no body and
129134 * parameters are passed in the URL query.
130135 */
131136 public HttpRequest get (URI uri );
132137
133138 /**
134- * Initialises the GET request builder . They have no request body and
139+ * Creates a new HEAD request . They have no request body and
135140 * parameters are passed in the URL query. They are identical to GET requests,
136- * the only difference is that the returned response contains headers only .
141+ * except they receive no response body .
137142 */
138143 public HttpRequest head (URI uri );
139144
140145 /**
141- * Initialises the POST request builder . Usually they contain data in the
146+ * Creates a new POST request. Usually they pass data in the
142147 * request body either as a urlencoded form, a multipart form or raw bytes.
143- * Currently, we only care about the multipart form .
148+ * Currently, we only care about the multipart and urlencoded forms .
144149 */
145150 public HttpRequest post (URI uri );
146151
147152 /**
148- * Initialises the PUT request builder which construct the same way as POST.
149- * The only difference is the request method.
153+ * Creates a new PUT request which is constructed the same way as POST.
150154 */
151155 public HttpRequest put (URI uri );
152156
153157 /**
154- * Initialises the DELETE request builder. The DELETE requests have no body
158+ * Creates a new DELETE request. THey have have no body
155159 * and parameters are passed in the URL query, just like GET.
156160 */
157161 public HttpRequest delete (URI uri );
0 commit comments