fix (JAVA SPRING RESTCLIENT) 19137: Fix missing imports when using withXml for Spring RestClient and fix its README (#19146)

This commit is contained in:
Nicklas Wiegandt
2024-07-17 11:47:33 +02:00
committed by GitHub
parent cfcc2c89d6
commit 045f4b6067
8 changed files with 50 additions and 56 deletions

View File

@@ -89,7 +89,7 @@ import org.openapitools.client.api.AuthApi;
public class AuthApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
ApiClient defaultClient = new ApiClient();
defaultClient.setBasePath("http://localhost:3000");
// Configure HTTP basic authorization: http_auth
@@ -101,10 +101,10 @@ public class AuthApiExample {
try {
String result = apiInstance.testAuthHttpBasic();
System.out.println(result);
} catch (ApiException e) {
} catch (HttpStatusCodeException e) {
System.err.println("Exception when calling AuthApi#testAuthHttpBasic");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Status code: " + e.getStatusCode().value());
System.err.println("Reason: " + e.getResponseBodyAsString());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}