22
33import com .github .diegonighty .http .request .types .HttpDeleteRequest ;
44import com .github .diegonighty .http .request .types .HttpGetRequest ;
5- import com .github .diegonighty .http .request .types .HttpPostRequest ;
5+ import com .github .diegonighty .http .request .types .HttpInputRequest ;
66import com .github .diegonighty .http .util .HeaderMap ;
77import java .util .Map ;
88
99public interface HttpConnection <T > {
1010
1111 /**
1212 * Add header to http request
13- * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
14- *
1513 * @param field Field that will be added in the headers of the request
1614 * @param value Value of the field, this will be serialized to string
17- *
1815 * @return The same connection with the changes
16+ * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
1917 */
2018 default <V > HttpConnection <T > addRequestField (RequestField field , V value ) {
2119 return addRequestField (field .parse (), value );
2220 }
2321
2422 /**
2523 * Add header to http request
26- * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
27- *
2824 * @param field Field that will be added in the headers of the request
2925 * @param value Value of the field, this will be serialized to string
30- *
3126 * @return The same connection with the changes
27+ * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
3228 */
3329 <V > HttpConnection <T > addRequestField (String field , V value );
3430
3531 /**
3632 * Add headers to http request
37- * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
38- *
3933 * @param map Map containing all fields and values, the values will be serialized to string
40- *
4134 * @return The same connection with the changes
35+ * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
4236 */
4337 default HttpConnection <T > addRequestFields (HeaderMap map ) {
4438 return addRequestFields (map .getHeaderMap ());
4539 }
4640
4741 /**
4842 * Add headers to http request
49- * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
50- *
5143 * @param map Map containing all fields and values, the values will be serialized to string
52- *
5344 * @return The same connection with the changes
45+ * @see <a href="https://en.wikipedia.org/wiki/List_of_HTTP_header_fields"> List of header fields and usage </a>
5446 */
5547 HttpConnection <T > addRequestFields (Map <String , Object > map );
5648
5749 /**
5850 * Performs a get request
59- *
6051 * @return get request
6152 */
6253 HttpGetRequest <T > createGetRequest ();
6354
6455 /**
6556 * Performs a post request
66- *
6757 * @return post request
6858 */
69- HttpPostRequest <T > createPostRequest ();
59+ HttpInputRequest <T > createPostRequest ();
60+
61+ /**
62+ * Performs a patch request
63+ * @return patch request (it really is a POST request, but spoofed with a header inside the connection)
64+ */
65+ HttpInputRequest <T > createPatchRequest ();
66+
67+ /**
68+ * Performs a put request
69+ *
70+ * @return put request
71+ */
72+ HttpInputRequest <T > createPutRequest ();
7073
7174 /**
7275 * Performs a delete request
@@ -83,7 +86,7 @@ enum HttpMethod {
8386
8487 GET ,
8588 POST ,
86- UPDATE ,
89+ PUT ,
8790 DELETE
8891
8992 }
0 commit comments