We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96b6660 commit 760d16aCopy full SHA for 760d16a
src/main/resources/archetype-resources/DEVELOPER_GUIDE.md
@@ -272,7 +272,15 @@ request.setMethod("POST")
272
.setBody("{\"key\":\"value\"}");
273
274
HTTPHandler handler = new HTTPHandler();
275
-String responseBody = handler.handleRequest(request).getBody();
+var response = handler.handleRequest(request);
276
+
277
+// Always check the status code before using the response body
278
+if (response.getStatusCode() == 200) {
279
+ String responseBody = response.getBody();
280
+ // Process the successful response
281
+} else {
282
+ // Handle the error (e.g., log response.getStatusCode())
283
+}
284
```
285
286
---
0 commit comments