GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JuliaWeb/LibCURL.jl: Julia wrapper for libcurl

BranchesTags
Open more actions menu

Latest commit

 

History

162 Commits
162 Commits

Folders and files

NameName
Last commit message
Last commit date
.ci
.ci
 
 
.github
.github
 
 
docs/src
docs/src
 
 
gen
gen
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
Project.toml
Project.toml
 
 
README.md
README.md
 
 

Repository files navigation

LibCURL.jl

Julia wrapper for libCURL

CI codecov.io


This is a simple Julia wrapper around http://curl.haxx.se/libcurl/ generated using Clang.jl. Please see the libcurl API documentation for help on how to use this package.

Example (fetch a URL)

using LibCURL

# init a curl handle
curl = curl_easy_init()

# set the URL and request to follow redirects
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com")
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)


# setup the callback function to recv data
function curl_write_cb(curlbuf::Ptr{Cvoid}, s::Csize_t, n::Csize_t, p_ctxt::Ptr{Cvoid})
    sz = s * n
    data = Array{UInt8}(undef, sz)

    ccall(:memcpy, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, UInt64), data, curlbuf, sz)
    println("recd: ", String(data))

    sz::Csize_t
end

c_curl_write_cb = @cfunction(curl_write_cb, Csize_t, (Ptr{Cvoid}, Csize_t, Csize_t, Ptr{Cvoid}))
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, c_curl_write_cb)


# execute the query
res = curl_easy_perform(curl)
println("curl url exec response : ", res)

# retrieve HTTP code
http_code = Array{Clong}(undef, 1)
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, http_code)
println("httpcode : ", http_code)

# release handle
curl_easy_cleanup(curl)

Binaries

This package uses the LibCURL_jll binary package to install compiled libCURL binaries on all supported platforms. The following products are defined in the jll

  • libcurl: A LibraryProduct referencing the shared library
  • curl: An ExecutableProduct referencing the binary

This package also uses the MozillaCACerts_jll package to supply the Mozilla CA root certificate bundle. Note that the cacert symbol is re-exported from this package for ease of use.

  • cacert: A FileProduct referencing the Mozilla CA certificate bundle

SSL certificates

Making SSL/TLS connections usually needs access to a CA certificate to validate peers. The Mozilla CA bundle can be used via this package. To use this certificate bundle, set the following option:

curl_easy_setopt(curl, CURLOPT_CAINFO, LibCURL.cacert)

About

Julia wrapper for libcurl

Resources

Readme
License

Security policy

Security policy
Activity
Custom properties

Stars

37 stars

Watchers

10 watching

Forks

29 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.