JAL-3954 Add content-type and content-length headers to phmmer request
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 15 Feb 2022 16:27:21 +0000 (17:27 +0100)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 15 Feb 2022 16:27:21 +0000 (17:27 +0100)
src/jalview/hmmer/rest/PhmmerClient.java

index 0dc9404..606dd9c 100644 (file)
@@ -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();