algorithmic modeling for Rhino
Hi Philipp,
can you elaborate on what you're looking to get?
Do you want to use the Rhino command line to ask the user for a string? Do you want to display a window where users can enter a string? ...?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
No no - I meant the standart HTTP GET command for ordinary API responses - as here https://developer.foursquare.com/docs/venues/search
I like how it realised in quadrigram (http://docs.quadrigram.com/) but It will be much handler to realise something like this in grasshopper for me
issues a GET request and returns the content of the response. This is useful to call APIs
Example | |
---|---|
executeHTTPGet |
Inlets list (* mandatory Inlets) | |
---|---|
* Stringfile url |
|
Objectissues a relaod when receiving any kind of data Default value: null |
Outlet | |
---|---|
String |
You could put this into a c# component with an input named 'url' that is of type string:
System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
System.Net.HttpWebResponse res = (System.Net.HttpWebResponse)req.GetResponse();
// Get the stream associated with the response.
Stream receiveStream = res.GetResponseStream();
StreamReader readStream = new StreamReader (receiveStream, System.Text.Encoding.UTF8);
A = readStream.ReadToEnd();
res.Close();
readStream.Close();
Maybe there is a cleaner way, but this works for me...
thanks Luis - and I should make the url as a joint of real url and a query sintax, right?
yes, it should be the whole thing all together...
Thank you Luis.
Is there some other way to achieve this result?
Just to wrap the theme, here is a slightly modified code by Luis Fraguada
and an example of how to use it, connecting to "Geo to politics" API from this Great great toolkit
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by