forked from loafle/openapi-generator-original
* feat (JAVA SPRING RESTTEMPLATE) 17571: initial commit for Spring RestClient * feat (JAVA SPRING RESTTEMPLATE) 17571: Copied and changed the webclient mustache files The RestClient API is oriented on the WebClient API so many parts of the templates can be the same * fix (JAVA SPRING RESTTEMPLATE) 17571: Renaming error & add README template The README must be changed because the minimal Java Version for this client is 17 * fix (JAVA SPRING RESTTEMPLATE) 17571: Imports, compile errors and cookie setting * feat (JAVA SPRING RESTTEMPLATE) 17571: Add generated samples * test (JAVA SPRING RESTTEMPLATE) 17571: Add tests * feat (JAVA SPRING RESTTEMPLATE) 17571: Update doc * Add the restcilent to samples-java-client-jdk17.yam The minimum Java version of the used Spring Version is 17 * fix (JAVA SPRING RESTTEMPLATE) 17571: Workflow paths to petstore samples * fix (JAVA SPRING RESTTEMPLATE) 17571: Regenerated samples * feat (JAVA SPRING RESTTEMPLATE) 17571: Generated echo-api sample for RestClient * fix (JAVA SPRING RESTTEMPLATE) 17571: Missing import * fix (JAVA SPRING RESTTEMPLATE) 17571: Missing body class exception when null body is set * test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Auth test * fix (JAVA SPRING RESTTEMPLATE) 17571: Gradlew file permissions * feat (JAVA SPRING RESTTEMPLATE) 17571: Reggenerate samples after rebase * test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Body gif test * test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api octet stream body test * test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api multipart form data test * fix (JAVA SPRING RESTTEMPLATE) 17571: Form as body when body is null Also regenerated the restclient samples
4.0 KiB
4.0 KiB
AuthApi
All URIs are relative to http://localhost:3000
Method | HTTP request | Description |
---|---|---|
testAuthHttpBasic | POST /auth/http/basic | To test HTTP basic authentication |
testAuthHttpBearer | POST /auth/http/bearer | To test HTTP bearer authentication |
testAuthHttpBasic
String testAuthHttpBasic()
To test HTTP basic authentication
To test HTTP basic authentication
Example
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.AuthApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
// Configure HTTP basic authorization: http_auth
HttpBasicAuth http_auth = (HttpBasicAuth) defaultClient.getAuthentication("http_auth");
http_auth.setUsername("YOUR USERNAME");
http_auth.setPassword("YOUR PASSWORD");
AuthApi apiInstance = new AuthApi(defaultClient);
try {
String result = apiInstance.testAuthHttpBasic();
System.out.println(result);
} catch (ApiException 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("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Parameters
This endpoint does not need any parameter.
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: text/plain
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |
testAuthHttpBearer
String testAuthHttpBearer()
To test HTTP bearer authentication
To test HTTP bearer authentication
Example
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.AuthApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
// Configure HTTP bearer authorization: http_bearer_auth
HttpBearerAuth http_bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("http_bearer_auth");
http_bearer_auth.setBearerToken("BEARER TOKEN");
AuthApi apiInstance = new AuthApi(defaultClient);
try {
String result = apiInstance.testAuthHttpBearer();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthApi#testAuthHttpBearer");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Parameters
This endpoint does not need any parameter.
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: text/plain
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |