forio / curl.jl Goto Github PK
View Code? Open in Web Editor NEWa Julia HTTP curl library
License: Other
a Julia HTTP curl library
License: Other
As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.
To transition to the new Pkg system using Project.toml
, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.
If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.
In the README I am advised to run:
cd ~/.julia/; git clone https://github.com/forio/Curl.jl.git Curl
But then the later install instructions fail:
julia> Pkg.update(); Pkg.add("Curl"); using Curl
Branch devel set up to track remote branch devel from origin.
Already up-to-date.
MESSAGE: Installing Curl v0.0.1
in anonymous at no file:163
ERROR: Path Curl already exists! Please remove to allow installation.
in _resolve at pkg.jl:378
in anonymous at no file:163
in cd at file.jl:25
in cd_pkgdir at pkg.jl:42
in add at pkg.jl:143
in add at pkg.jl:175
The solution was to delete the repo and only run:
julia> Pkg.update(); Pkg.add("Curl"); using Curl
Curl.put(url, ehrmahgerd_derta)
julia> using Curl
julia> Curl.get("http://jsonip.com")
--Process exits--
Illegal instruction
Is this because I don't have libcurl? I didn't install this as a package either. Just git cloned and ran Julia.
When running Curl.get("http://jsonip.com").text
I get the message:
WARNING: unsafe_ref is deprecated, use unsafe_load instead.
in gen_write_cb at /Users/erikengheim/.julia/Curl/src/Curl.jl:75
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "help()" for help.
| | | | | | |/ ` | |
| | || | | | (| | | Version 0.4.0-dev+2847 (2015-01-21 18:34 UTC)
/ |_'|||__'| | Commit fc61385 (28 days old master)
|__/ | x86_64-w64-mingw32
julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating cache of StatsBase...
INFO: Updating LinearAlgebra...
INFO: Computing changes...
INFO: Upgrading StatsBase: v0.6.11 => v0.6.12
julia> Pkg.add("Curl")
INFO: Cloning cache of Curl from git://github.com/forio/Curl.jl.git
INFO: Installing Curl v0.0.3
INFO: Package database updated
julia> using Curl
WARNING: deprecated syntax "{a=>b, ...}" at C:\Users\SAMSUNG2.julia\v0.4\Curl\src\Curl.jl:15.
Use "Dict{Any,Any}(a=>b, ...)" instead.
WARNING: deprecated syntax "{a=>b, ...}" at C:\Users\SAMSUNG2.julia\v0.4\Curl\src\Curl.jl:113.
Use "Dict{Any,Any}(a=>b, ...)" instead.
WARNING: Curl.jl has been deprecated. Please check out Requests.jl (http://github.com/loladiro/Requests.jl) for al
l your HTTP client needs.
julia> using JSON
julia> Curl.get("http://jsonip.com").text
ERROR: error compiling get: error compiling setup_curl: error compiling curl_version: could not load module libcur
l: no error
julia>
Curl.options(url)
Given the interest in curl wrappers as dicussed here - https://groups.google.com/forum/?fromgroups=#!topic/julia-dev/ax9OVSBA_OE, can we register Curl.jl as a package in METADATA?
Since promises are apparently cool right now, I feel like I should raise this issue.
We shouldn't really have blocking HTTP requests. Can we have the verbs return a promise object, such that I can do:
Curl.get("http://jsonip.com").then((res) -> println(res.text))
Then would take three arguments: onResolved, onError, and onProgress.
I would express it like this:
type Promise
then::Function
resolved_callbacks::Vector
rejected_callbacks::Vector
progress_callbacks::Vector
resolve::Function
reject::Function
progress::Function
function then(on_resolved, on_error, on_progress)
# push callbacks into queues
end
function resolve(value)
# if no handlers left return
# shift handler off queue
# invoke handler with value
# recurse
end
function reject(error)
# if no handlers left return
# shift handler off queue
# invoke handler with value
# recurse
end
function progress(value)
# if no handlers left return
# shift handler off queue
# invoke handler with value
# recurse
end
function Promise()
new(then, [], [], [], resolve, reject, progress)
end
end
get = function (url)
promise = Promise()
on_complete(data) = promise.resolve
on_error(error) = promise.reject
on_progress(data) = promise.progress
do_curl() # with appropriate arguments
promise;
end
Of course that doesn't allow us to chain then
calls, but in general I find chaining to be very difficult in Julia. There may be a way to do it. We could also just pass in handlers as a vector of functions instead of just one function.
Open to other approaches too.
Need to push a new version the prints a deprecated message. Also make a note in the README.
Curl.patch(url, ehrmahgerd_derta)
This issue is being filed by a script, but if you reply, I will see it.
PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their test (if available) on both the stable version of Julia (0.2) and the nightly build of the unstable version (0.3).
The results of this script are used to generate a package listing enhanced with testing results.
The status of this package, Curl, on...
'No tests, but package loads.' can be due to their being no tests (you should write some if you can!) but can also be due to PackageEvaluator not being able to find your tests. Consider adding a test/runtests.jl
file.
'Package doesn't load.' is the worst-case scenario. Sometimes this arises because your package doesn't have BinDeps support, or needs something that can't be installed with BinDeps. If this is the case for your package, please file an issue and an exception can be made so your package will not be tested.
This automatically filed issue is a one-off message. Starting soon, issues will only be filed when the testing status of your package changes in a negative direction (gets worse). If you'd like to opt-out of these status-change messages, reply to this message.
Even though curl work perfectly from command line.
Any idea what's wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.