11package com .monday .xsoup ;
22
3+ import com .monday .xsoup .helper .HttpConnection .Request ;
34import com .monday .xsoup .nodes .Document ;
45import com .monday .xsoup .parser .Parser ;
56
@@ -24,7 +25,7 @@ public interface Connection {
2425 * GET and POST http methods.
2526 */
2627 public enum Method {
27- GET , POST
28+ GET , POST , PUT , DELETE , HEAD
2829 }
2930
3031 /**
@@ -131,19 +132,29 @@ public enum Method {
131132 /**
132133 * Add a number of request data parameters. Multiple parameters may be set at once, e.g.:
133134 * <code>.data("name", "jsoup", "language", "Java", "language", "English");</code> creates a query string like:
134- * <code>?name=jsoup &language=Java&language=English</code>
135+ * <code>?name=xsoup &language=Java&language=English</code>
135136 * @param keyvals a set of key value pairs.
136137 * @return this Connection, for chaining
137138 */
138139 public Connection data (String ... keyvals );
139140
141+ /**
142+ * Add a number of request data parameters. Multiple parameters may be set at once, e.g.:
143+ * <code>.data("name", "jsoup", "language", "Java", "language", "English");</code> creates a query string like:
144+ * <code>?name=xsoup&language=Java&language=English</code>
145+ * @param keyvals a set of key value pairs.
146+ * @return this Connection, for chaining
147+ * */
148+
149+ public Connection dataBinary (byte [] byteArray );
140150 /**
141151 * Set a request header.
142152 * @param name header name
143153 * @param value header value
144154 * @return this Connection, for chaining
145155 * @see com.monday.xsoup.Connection.Request#headers()
146156 */
157+
147158 public Connection header (String name , String value );
148159
149160 /**
@@ -178,6 +189,42 @@ public enum Method {
178189 * @throws IOException on error
179190 */
180191 public Document get () throws IOException ;
192+
193+ /**
194+ * Execute the request as a GET, and parse the result.
195+ * @return parsed Document
196+ * @throws java.net.MalformedURLException if the request URL is not a HTTP or HTTPS URL, or is otherwise malformed
197+ * @throws HttpStatusException if the response is not OK and HTTP response errors are not ignored
198+ * @throws UnsupportedMimeTypeException if the response mime type is not supported and those errors are not ignored
199+ * @throws java.net.SocketTimeoutException if the connection times out
200+ * @throws IOException on error
201+ */
202+ public Document put () throws IOException ;
203+
204+ /**
205+ * Execute the request as a GET, and parse the result.
206+ * @return parsed Document
207+ * @throws java.net.MalformedURLException if the request URL is not a HTTP or HTTPS URL, or is otherwise malformed
208+ * @throws HttpStatusException if the response is not OK and HTTP response errors are not ignored
209+ * @throws UnsupportedMimeTypeException if the response mime type is not supported and those errors are not ignored
210+ * @throws java.net.SocketTimeoutException if the connection times out
211+ * @throws IOException on error
212+ */
213+ public Document delete () throws IOException ;
214+
215+
216+ /**
217+ * Execute the request as a GET, and parse the result.
218+ * @return parsed Document
219+ * @throws java.net.MalformedURLException if the request URL is not a HTTP or HTTPS URL, or is otherwise malformed
220+ * @throws HttpStatusException if the response is not OK and HTTP response errors are not ignored
221+ * @throws UnsupportedMimeTypeException if the response mime type is not supported and those errors are not ignored
222+ * @throws java.net.SocketTimeoutException if the connection times out
223+ * @throws IOException on error
224+ */
225+ public Document head () throws IOException ;
226+
227+
181228
182229 /**
183230 * Execute the request as a POST, and parse the result.
@@ -415,6 +462,8 @@ public interface Request extends Base<Request> {
415462 * @return this Request, for chaining
416463 */
417464 public Request data (KeyVal keyval );
465+
466+
418467
419468 /**
420469 * Get all of the request's data parameters
@@ -434,6 +483,20 @@ public interface Request extends Base<Request> {
434483 * @return current Parser
435484 */
436485 public Parser parser ();
486+
487+ /**
488+ * set a dataBinary parameter to the request
489+ * @param byteArray data to set.
490+ * @return this Request, for chaining
491+ */
492+ public Request dataBinary (byte [] byteArray ) ;
493+
494+ /**
495+ * get a dataBinary parameter of the request
496+ *
497+ * @return this byte[]
498+ */
499+ public byte [] dataBinary () ;
437500 }
438501
439502 /**
0 commit comments