web:make-request
and
using a Google Form, so I assume you're doing an HTTP POST
request? If so, you can use the http-req
extension
in NetLogo Web. It's undocumented and mostly unsupported, but it does work. After adding extensions [ http-req ]
to
your code you can do something like http-req:post "https://netlogoweb.org" "hello" "text/plain"
, with the
arguments being the URL, the message itself, and the message type. It will report the response from the server. The downsides are many. The extension is not also supported in desktop NetLogo meaning you'll need separate models for each platform. It's a blocking
call, meaning your model can freeze if the network is slow to respond or doesn't respond at all for some reason. It doesn't handle any error conditions, so if anything goes wrong the effects could be frustrating.GET
request
for your form URL, you can actually use the
Fetch Extension, like fetch:url-async "http://www.netlogoweb.org/" show
. It is supported in NetLogo Web
and desktop NetLogo and well documented. One difference from the Web Extension is that if you want to check the response from the server you will have to use an anonymous task that will run asynchronously after the request is completed. It doesn't seem like
that'd be a big deal for your use case, but just pointing it out."In NetLogo Web the target for an extension must be JavaScript, and at the moment the only way to include an extension is by bundling it with the NetLogo Web code itself as part of Tortoise. This is all experimental, and we may change the definition file format or the way extensions are loaded as needed for future work. Longer-term the NetLogo team has plans to provide a mechanism to allow inclusion of third party extensions that are external to the NetLogo Web site, but that work is not yet complete."
Direttore del Centro Interdipartimentale per lo Studio di Dinamiche Complesse (CSDC)
Professore Associato
(tel.) +39 0554572336; (cell.) +39 3386586493;
UNIVERSITÀ DEGLI STUDI DI FIRENZE
Dipartimento di Fisica e Astronomia