ProxyAPI
Method | HTTP request | Description |
---|---|---|
callProxy | POST /proxy | Calls a pre-defined proxy service with the provided data |
#
callProxyCalls a pre-defined proxy service with the provided data Returns the response from the proxied service as a string
#
Request with Combine's publisher:public func callProxyPublisher(body: ProxyCallParameters) -> AnyPublisher<ProxyResult, APIError>
#
Example:import YatLib
let body = ProxyCallParameters(service: "service_example", data: "data_example") // ProxyCallParameters | var cancelables = Set<AnyCancellable>()
Yat.api.proxy.callProxyPublisher(body: body) .sink( receiveCompletion: { [weak self] in /* Handle completion/failure */ }, receiveValue: { /* Handle response */ } ) .store(in: &cancelables)
#
Request with closure:public func callProxy(body: ProxyCallParameters, result: @escaping (Result<ProxyResult, APIError>) -> Void)
#
Exampleimport YatLib
let body = ProxyCallParameters(service: "service_example", data: "data_example") // ProxyCallParameters |
Yat.api.proxy.callProxy(body: ProxyCallParameters { result in switch result { case let .success(model): // Handle response case let .failure(error): // Handle failure }}
#
ParametersName | Type | Description | Notes |
---|---|---|---|
body | ProxyCallParameters |
#
Return type#
Authorization[Back to top] [Back to API list] [Back to Model list] [Back to index]