Skip to content

Commit 0bddba1

Browse files
committed
Group HttpOpener body setter together with URL setter. (#513)
1 parent 0aafe05 commit 0bddba1

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

metafacture-io/src/main/java/org/metafacture/io/HttpOpener.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,23 +148,6 @@ public void setAccept(final String accept) {
148148
setHeader(ACCEPT_HEADER, accept);
149149
}
150150

151-
/**
152-
* Sets the HTTP request body. The default value for the request body is
153-
* {@value INPUT_DESIGNATOR} <i>if the {@link #setMethod(Method) request
154-
* method} accepts a request body</i>, which means it will use the {@link
155-
* #process(String) input data} data as request body <i>if the input has
156-
* not already been used</i>; otherwise, no request body will be set by
157-
* default.
158-
*
159-
* <p>If a request body has been set, but the request method does not
160-
* accept a body, the method <i>may</i> be changed to {@code POST}.
161-
*
162-
* @param body the request body
163-
*/
164-
public void setBody(final String body) {
165-
this.body = body;
166-
}
167-
168151
/**
169152
* Sets the HTTP {@value CONTENT_TYPE_HEADER} header value. This is a
170153
* MIME type such as {@code text/plain} or {@code application/json}.
@@ -284,6 +267,23 @@ public void setUrl(final String url) {
284267
this.url = url;
285268
}
286269

270+
/**
271+
* Sets the HTTP request body. The default value for the request body is
272+
* {@value INPUT_DESIGNATOR} <i>if the {@link #setMethod(Method) request
273+
* method} accepts a request body</i>, which means it will use the {@link
274+
* #process(String) input data} data as request body <i>if the input has
275+
* not already been used</i>; otherwise, no request body will be set by
276+
* default.
277+
*
278+
* <p>If a request body has been set, but the request method does not
279+
* accept a body, the method <i>may</i> be changed to {@code POST}.
280+
*
281+
* @param body the request body
282+
*/
283+
public void setBody(final String body) {
284+
this.body = body;
285+
}
286+
287287
@Override
288288
public void process(final String input) {
289289
try {

0 commit comments

Comments
 (0)