-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I'm trying to fetch some data of a simple rest api, but I always get a "unsupported URL error" even when using https://www.google.com as the URL...
here's my code:
void ScopeAudioProcessorEditor::tryRESTCall()
{
RestRequest request;
request.header ("Content-Type", "application/json");
RestRequest::Response response = request.get ("https://jsonplaceholder.typicode.com/todos/1").execute();
DBG ("REST API bodyAsString: " + response.bodyAsString);
}
This is the error:
2022-04-22 17:03:41.969742+0200 Live[5602:150721] Task <FB2F127C-A29C-42D0-82E5-0BA726F84FF3>.<1> finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSErrorFailingURLStringKey=/https://jsonplaceholder.typicode.com/todos/1, NSErrorFailingURLKey=/https://jsonplaceholder.typicode.com/todos/1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <FB2F127C-A29C-42D0-82E5-0BA726F84FF3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <FB2F127C-A29C-42D0-82E5-0BA726F84FF3>.<1>, NSUnderlyingError=0x60000130ba50 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSErrorFailingURLStringKey=/https://jsonplaceholder.typicode.com/todos/1, NSErrorFailingURLKey=/https://jsonplaceholder.typicode.com/todos/1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <FB2F127C-A29C-42D0-82E5-0BA726F84FF3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <FB2F127C-A29C-42D0-82E5-0BA726F84FF3>.<1>, NSUnderlyingError=0x60000130ba50 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
Any ideas?
Thnx
Metadata
Metadata
Assignees
Labels
No labels