File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
core/src/main/java/org/testcontainers/containers/wait/strategy Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public class HttpWaitStrategy extends AbstractWaitStrategy {
3535 private static final String AUTH_BASIC = "Basic " ;
3636
3737 private String path = "/" ;
38+ private String method = "GET" ;
3839 private Set <Integer > statusCodes = new HashSet <>();
3940 private boolean tlsEnabled ;
4041 private String username ;
@@ -97,6 +98,17 @@ public HttpWaitStrategy usingTls() {
9798 return this ;
9899 }
99100
101+ /**
102+ * Indicates the HTTP method to use (<code>GET</code> by default).
103+ *
104+ * @param method the HTTP method.
105+ * @return this
106+ */
107+ public HttpWaitStrategy withMethod (String method ) {
108+ this .method = method ;
109+ return this ;
110+ }
111+
100112 /**
101113 * Authenticate with HTTP Basic Authorization credentials.
102114 *
@@ -167,7 +179,7 @@ protected void waitUntilReady() {
167179 connection .setUseCaches (false );
168180 }
169181
170- connection .setRequestMethod ("GET" );
182+ connection .setRequestMethod (method );
171183 connection .connect ();
172184
173185 log .trace ("Get response code {}" , connection .getResponseCode ());
You can’t perform that action at this time.
0 commit comments