Maxurl

wbreidi's icon

Hi,
I am trying to ownload a json file from an internet page. When I do it with a navigator it works fine but when I use the [maxurl] object I get this error message :
maxurl: doesn't understand ""PM10""
maxurl: doesn't understand "”PM2.5""
maxurl: can't create potential file name noise:/
maxurl: can't create potential file name noise:/
maxurl: Failed writing body (0 != 164)
Here is the link I use: https://portal.opendata.dk/api/3/action/datastore_search_sql?sql=SELECT noise, "PM10", "PM2.5" from "7e85ea85-3bde-4dbf-944b-0360c6c47e3b" limit 10
Am I formatting the message wrongly?
Thanks for your help.

yaniki's icon

I think, [maxurl] is unable to handle this syntax. Try [jweb] or [node.script].

wbreidi's icon

I tried [jweb] and it displays only the header not the whole file !

Rob Ramirez's icon

you need to embed the request in a dict object, and properly escape spaces and quotes (i simply pasted into a web browser and copied the reformatted url).

Max Patch
Copy patch and select New From Clipboard in Max.

wbreidi's icon

Great, thanks Rob, it works fine but can I tell the [dict] object that the file is a json file and so get a better json format of data, if so how ?

August Black's icon

Add { "parse_type": "json"} to your request dictionary like so:

Max Patch
Copy patch and select New From Clipboard in Max.

wbreidi's icon

Great, it works, thanks August.