Open dataexcess opened 2 years ago
Which platform are you running this on?
macOS 12.3.1 XCode
What do you get when you call getBodyAsString
or getURL
on the Request object?
It gives the same error :(
I mean before you make the call. On the request
object, not the response
.
I could fix the issue by bypassing the url.getChildURL(endpoint) method call in the exectue() method. This seems to add a slash in front of my url...
RestRequest::Response execute ()
{
auto urlRequest = URL(endpoint);
//auto urlRequest = url.getChildURL (endpoint);
bool hasFields = (fields.getProperties().size() > 0);
if (hasFields)
{
So now it works! thnx
Can you please post the results of getBodyAsString
and getURL
on the Request
object? (before you made your change) - so I can understand the issue.
I suspect it's not expecting a full URL string with http
at the front..
I called getBodyAsString on the Request object and it gives the same error. Before and after the execute method.
I think the problem is the prefix slash that Juce::URL adds in concatenatePaths() which is called by URL::getChildURL(), itself called by RestRequest::Response execute().
As you can see in your error : NSErrorFailingURLStringKey=/https://jsonplaceholder.typicode.com/todos/1
I don't really understand the logic of the code and why it works on Windows and not MacOS though.
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:
This is the error:
Any ideas? Thnx