How to use Red cURL binding?

I'm just starting out with Red, and I need help to work with the cURL binding.

The cURL link from the red-lang main site will bring you here

http://red.esperconsultancy.nl/Red-cURL/dir?ci=tip

But there is only a small example of using Red / System, so I'm not sure how to directly load the binding into Red.

I need this to work on Mac, Linux, and possibly Windows, so I would appreciate any pointers to the differences between these platforms.

+6
source share
1 answer

A few questions:

  • Further, there are dependencies between the bindings. I support github clone if you do not want to use script download.r in Red-test fossil files. The cURL library explicitly depends on the binding of the C library. I have not looked, but it seems to depend on the overall binding at a lower level.

  • Due to the lack of url! type url! in Red, at the moment you are more specifically passing the read-url a string! function string! or c-string! .

  • When using red / system bindings used in red, the ideal situation is to have a wrapper that abstracts the lower-level code. You can see this on TryRebol with the launch of read "http://www.google.com" . Although this console assembly does not seem to use the cURL binding for this implementation.

  • To use the red / System binding in red, you need to use the #system-global directive. Here is a simple script that captures data from a website:

     Red[] #system-global [ #include %../cURL.reds with curl [ print read-url "http://www.red-lang.org" ] ] 
+7
source

All Articles