C bindings for the libcurl library
This module map links to the cURL library in Swift for the implementation of the HTTP protocol and other networking protocols.
Modulemap for the libcurl library
License: Apache License 2.0
C bindings for the libcurl library
This module map links to the cURL library in Swift for the implementation of the HTTP protocol and other networking protocols.
Notifying that this library cannot be loaded in linux systems other than Debian due to the use of .Apt. In my case I am trying to use /pixelspark/catena.git in an Archlinux system and it fails because of this. Are there ways of avoiding hardcoding apt-get into this library?
Thank you
When trying to use the Stripe API with Swift and cURL I keep receiving complaints from the server along the lines of "Invalid UTF-8 characters found in POST body." On top of that, the behavior seems to be inconsistent and the request will occasionally be accepted by their server, but none of the post fields are used. I put up a repo to show the code I used and I'm wondering if I'm just using cURL/CCurl wrong or if this is a bug.
(this is a question, if someone could please add the label)
In an attempt to use CCurl to develop an SMTP client in Swift, I ran into this problem where the inline functions in shim.h produce linker errors on Linux. macOS works fine.
Functions such as curlHelperSetOptString and curlHelperSetOptInt work fine inside Kitura, but when they are used in an app, a multiple definition of 'curlHelperSetOptString'
error occurs.
The functions are defined as inline in shim.h so I am not sure why the compiler is creating a symbol.
Attached is a HelloWorld Kitura based sample app that demonstrates the problem. Tun run execute:
docker-compose up
I have tried a few changes such as changing "extern inline" to "inline", or moving the declarations to a 'C' file but these cause different issues.
Error output:
test_1 | Compile Swift Module 'LoggerAPI' (1 sources)
test_1 | Compile Swift Module 'Socket' (3 sources)
test_1 | Compile Swift Module 'SwiftyJSON' (2 sources)
test_1 | Compile Swift Module 'KituraTemplateEngine' (1 sources)
test_1 | Compile CHttpParser utils.c
test_1 | clang: warning: argument unused during compilation: '-Xcc'
test_1 | Compile CHttpParser http_parser.c
test_1 | Compile Swift Module 'KituraSys' (3 sources)
test_1 | clang: warning: argument unused during compilation: '-Xcc'
test_1 | Linking CHttpParser
test_1 | Compile Swift Module 'KituraNet' (12 sources)
test_1 | Compile Swift Module 'Kitura' (35 sources)
test_1 | Compile Swift Module 'HelloWorld' (1 sources)
test_1 | Linking .build/debug/HelloWorld
test_1 | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptInt'
test_1 | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1 | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptList'
test_1 | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1 | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptReadFunc'
test_1 | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1 | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptString'
test_1 | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1 | clang: error: linker command failed with exit code 1 (use -v to see invocation)
test_1 | <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
test_1 | <unknown>:0: error: build had 1 command failures
test_1 | swift-build: error: exit(1): /root/swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a-ubuntu15.10/usr/bin/swift-build-tool -f /test/.build/debug.yaml
helloworld_test_1 exited with code 1
Seems that 0.0.2 breaks installation with this error:
Target: x86_64-unknown-linux-gnu
/root/swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a-ubuntu15.10/usr/bin/swift -frontend -interpret /data/swift/tori/Packages/CCurl/Package.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /root/swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a-ubuntu15.10/usr/lib/swift/pm -module-name Package -lPackageDescription -- -fileno 3
/data/swift/tori/Packages/CCurl/Package.swift:19:22: error: incorrect argument labels in call (have 'name:pkgConfig:providers:', expected 'name:targets:dependencies:')
let package = Package(
^
looking at the error seems pretty related to the new struct of the package file
Consider cherry picking / integrating @dmcyk wrapper.
https://github.com/dmcyk/SwiftyCurl/blob/master/Sources/SwiftyCurl/cURLConnection.swift
I want to enable OCSP Stapling, according to CURL I should set CURLOPT_SSL_VERIFYSTATUS.
In XCode the project is building. But on linux I'll get the following error:
/root/project/.build-ubuntu/checkouts/Kitura-net/Sources/KituraNet/ClientRequest.swift:652:38: error: use of unresolved identifier 'CURLOPT_SSL_VERIFYSTATUS'
curlHelperSetOptInt(handle!, CURLOPT_SSL_VERIFYSTATUS, 1)
^~~~~~~~~~~~~~~~~~~~~~~~
CCurl.CURLOPT_SSL_VERIFYHOST:1:12: note: did you mean 'CURLOPT_SSL_VERIFYHOST'?
public var CURLOPT_SSL_VERIFYHOST: CURLoption { get }
^
CCurl.CURLOPT_SSL_VERIFYPEER:1:12: note: did you mean 'CURLOPT_SSL_VERIFYPEER'?
public var CURLOPT_SSL_VERIFYPEER: CURLoption { get }
Here is my Kitura-Net Fork I used to implement this:
https://github.com/geertberkers/Kitura-net/blob/c99aabe49911b24dd3c22d403e25014051694912/Sources/KituraNet/ClientRequest.swift#L652
Are there any plans to document the simple usage of this library?
It would be nice to show some simple example in the readme to give an outlook how to use it.
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.