Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to make http GET requests withGDL?

Mihalcea Bogdan
Contributor
I need to read from an API which gives me a JSON or TXT containing information like dimensions, price, barcode etc.
Can I make this with GDL or I have to make an AddOn?
8 REPLIES 8

Peter Baksa
Graphisoft
Graphisoft
Hi Mihalcea,

You can read local files with GDL but for HTTP requests you will need to write an add-on.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Mihalcea Bogdan
Contributor
Peter wrote:
Hi Mihalcea,

You can read local files with GDL but for HTTP requests you will need to write an add-on.
Is it possible to create a GDL Addon for such requests?

Lingwisyer
Champion
Mihalcea wrote:
Is it possible to create a GDL Addon for such requests?

Possible, yes.
Will GS code one, probably not anytime soon unless there is huge demand for it.

If you really need it, your best option is probably to write one yourself or hire someone to do it for you.



Ling.
AC22-23 AUS 7000
Self-taught, bend it till it breaks.

Win10 | E5620 x 2 | 24GB | K2200 RIP PSU
Win10 | R5 2600 | 16GB | GTX1660

Mihalcea Bogdan
Contributor
Lingwisyer wrote:
Mihalcea wrote:
Is it possible to create a GDL Addon for such requests?

Possible, yes.
Will GS code one, probably not anytime soon unless there is huge demand for it.

If you really need it, your best option is probably to write one yourself or hire someone to do it for you.



Ling.
Any documentation on how to make GDL Addons ? Can I make in C++ API GDL AddOns?

runxel
Ace
Mihalcea wrote:
Any documentation on how to make GDL Addons ? Can I make in C++ API GDL AddOns?
Not much, really. The documentation is super sparse.
The best thing next I know off, is my own documentation and template I made out of frustration.
Seems a bit like GS doesn't want to support that in the future.
People like the great Ralph Wessel also campaign to not develop any new GDL Add-ons, since they are so limited (see note below). Instead I think he and others switched to use the regular C++ API and then "fill in" objects. This however has other drawbacks of course (e.g. the Add-On has to be tailored to the object).

Beware:
GDL Add-ons are very limited and can not interact with the project or communicate with other add-ons. They are truly independent.
You should just use them to offload heavy tasks or computations you can't do in GDL (like bitwise calculations or I/O).
Making HTTP request would surely work as well.
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Mihalcea Bogdan
Contributor
@runxel
Pure gold what you shared on your GitHub. I feel you with the frustration part!

runxel
Ace
Mihalcea wrote:
@runxel
Pure gold what you shared on your GitHub. I feel you with the frustration part!
Thank you for the kind words! I hope it will be helpful for others.
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Peter Baksa
Graphisoft
Graphisoft
If the HTTP API sends data that might change after an object is placed, the objects would need to be rebuilt (executing the GDL request) each time they are drawn on the screen or a layout. I am not sure whether a GDL add-on can do this, please consult the developer forum or ask developer support.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!