From 6a19c43fbc25a601b458ac6bb12aa64373822395 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Tue, 15 Feb 2022 17:27:21 +0100 Subject: [PATCH] JAL-3954 Add content-type and content-length headers to phmmer request --- src/jalview/hmmer/rest/PhmmerClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jalview/hmmer/rest/PhmmerClient.java b/src/jalview/hmmer/rest/PhmmerClient.java index 0dc9404..606dd9c 100644 --- a/src/jalview/hmmer/rest/PhmmerClient.java +++ b/src/jalview/hmmer/rest/PhmmerClient.java @@ -114,6 +114,8 @@ public class PhmmerClient { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoInput(true); connection.setDoOutput(true); + connection.addRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + connection.addRequestProperty("Content-Length", Integer.toString(body.length)); connection.connect(); connection.getOutputStream().write(body); int statusCode = connection.getResponseCode(); -- 1.7.10.2