Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend HttpOpener. #463

Merged
merged 12 commits into from
Sep 8, 2022
11 changes: 5 additions & 6 deletions metafacture-io/src/main/java/org/metafacture/io/HttpOpener.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ public final class HttpOpener extends DefaultObjectPipe<String, ObjectReceiver<R
private static final Pattern HEADER_FIELD_SEPARATOR = Pattern.compile("\n");
private static final Pattern HEADER_VALUE_SEPARATOR = Pattern.compile(":");

private static final String ACCEPT_HEADER = "accept";
private static final String ENCODING_HEADER = "accept-charset";
private static final String ACCEPT_DEFAULT = "*/*";
private static final String CONTENT_TYPE_HEADER = "content-Type";
private static final String CONTENT_TYPE_DEFAULT = "application/json";
private static final String ACCEPT_HEADER = "accept";
private static final String CONTENT_TYPE_HEADER = "content-type";
private static final String DEFAULT_PREFIX = "ERROR: ";
private static final String ENCODING_DEFAULT = "UTF-8";
private static final String ENCODING_HEADER = "accept-charset";
private static final String INPUT_DESIGNATOR = "@-";
private static final String DEFAULT_PREFIX = "ERROR: ";

private static final Method DEFAULT_METHOD = Method.GET;

Expand Down Expand Up @@ -98,7 +97,7 @@ private boolean getInputAsBody() {
*/
public HttpOpener() {
setAccept(ACCEPT_DEFAULT);
setContentType(CONTENT_TYPE_DEFAULT);
setContentType(ACCEPT_DEFAULT);
blackwinter marked this conversation as resolved.
Show resolved Hide resolved
setEncoding(ENCODING_DEFAULT);
setErrorPrefix(DEFAULT_PREFIX);
setMethod(DEFAULT_METHOD);
Expand Down