All Projects → beetlex-io → HttpClients

beetlex-io / HttpClients

Licence: Apache-2.0 license
BeetleX http/websocket client support ssl

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to HttpClients

cie-cns-apache-docker
L'obiettivo di questo progetto è quello di fornire un template pronto all'uso che realizza un sistema di autenticazione tramite la Smart Card TS-CNS (o CNS) e la CIE (Carta d'Identità Elettronica) basato su Apache HTTP. Ognuno può poi modificare o specializzare questo progetto sulla base delle proprie esigenze Si tratta di un progetto docker per…
Stars: ✭ 48 (+65.52%)
Mutual labels:  tls
acmed
ACME (RFC 8555) client daemon
Stars: ✭ 121 (+317.24%)
Mutual labels:  tls
Delphi SChannelTLS
Helper functions and socket classes to perform TLS communication by means of WinAPI (SChannel)
Stars: ✭ 22 (-24.14%)
Mutual labels:  tls
tlstools
🔐 CLI tool to analyze, troubleshoot or inspect SSL certificates, requests or keys.
Stars: ✭ 45 (+55.17%)
Mutual labels:  tls
sslcontext-kickstart
🔐 A lightweight high level library for configuring a http client or server based on SSLContext or other properties such as TrustManager, KeyManager or Trusted Certificates to communicate over SSL TLS for one way authentication or two way authentication provided by the SSLFactory. Support for Java, Scala and Kotlin based clients with examples. Av…
Stars: ✭ 295 (+917.24%)
Mutual labels:  tls
ssl-cert-check
Check expiry dates of local and remote SSL certificates
Stars: ✭ 28 (-3.45%)
Mutual labels:  tls
wolfssl-py
Python wrapper for wolfSSL embedded SSL/TLS library.
Stars: ✭ 30 (+3.45%)
Mutual labels:  tls
certctl
A command line tool able to request certificate generation from Vault to write certificate files to the local filesystem.
Stars: ✭ 13 (-55.17%)
Mutual labels:  tls
Yandex.Music.Api
Client Yandex.Music.Api for Yandex.Music
Stars: ✭ 53 (+82.76%)
Mutual labels:  https-client
cero
Scrape domain names from SSL certificates of arbitrary hosts
Stars: ✭ 316 (+989.66%)
Mutual labels:  tls
v2ray-tls-websocket-nginx
🌎The ULTIMATE V2Ray proxy configuration powered by Project V.
Stars: ✭ 29 (+0%)
Mutual labels:  tls
openssl
Fork of OpenSSL that includes prototype quantum-resistant algorithms and ciphersuites based on liboqs
Stars: ✭ 215 (+641.38%)
Mutual labels:  tls
TLS-Redirection
TLS Redirection
Stars: ✭ 109 (+275.86%)
Mutual labels:  tls
helix-sandbox
Middleware for secure IoT provisioning, access and control.
Stars: ✭ 23 (-20.69%)
Mutual labels:  tls
BabaSSL
A Brisk and Better Assured Cryptographic Toolkit
Stars: ✭ 361 (+1144.83%)
Mutual labels:  tls
tlstun
A socks tunnel client and server using websockets over http and tls
Stars: ✭ 36 (+24.14%)
Mutual labels:  tls
netman
高性能的TCP网络框架、支持TLS、可配置的路由、websocket、基于事件循环(epoll),百万连接(C1000K)
Stars: ✭ 96 (+231.03%)
Mutual labels:  tls
ssldump
ssldump - (de-facto repository gathering patches around the cyberspace)
Stars: ✭ 160 (+451.72%)
Mutual labels:  tls
GCXTrustPolicy
SSL pinning and trust validation framework for iOS
Stars: ✭ 21 (-27.59%)
Mutual labels:  tls
gls
goroutine local storage (use context instead if possible)
Stars: ✭ 52 (+79.31%)
Mutual labels:  tls

HttpClients

BeetleX http and websocket clients for .net standard2.0

Install

Install-Package BeetleX.Http.Clients -Version 1.6
            var result = await "https://www.baidu.com/"
                    .FormUrlRequest()
                    .Get();
            Console.WriteLine(result.Body);

            result = await "https://httpbin.org/get"
                     .FormUrlRequest()
                     .Get();
            Console.WriteLine(result.Body);


            result = await "https://httpbin.org/post"
                     .JsonRequest()
                     .SetBody(DateTime.Now)
                     .Post();
            JToken rdata = result.GetResult<JToken>()["data"];

            Console.WriteLine(rdata);


            var buffer = await "https://httpbin.org/image"
                           .BinaryRequest()
                           .Download();

             result = await "http://localhost/Upload"
                           .FormDataRequest()
                           .Upload("g:\\extension_1_4_3_0.rar", "g:\\extension_1_4_3_0_1.rar");

Http Cluster

HttpCluster httpCluster = new HttpCluster();
httpCluster.DefaultNode
.Add("http://192.168.2.25:8080")
.Add("http://192.168.2.26:8080");
var client = httpCluster.JsonRequest("/customers?count=10");
var data = await client.Get();
client = httpCluster.JsonRequest("/orders?size=10");
data = await client.Get();

Http Cluster interface

    public interface INorthWind
    {
        Task<Employee> GetEmployee(int id);
        [Post]
        Task<Employee> Add(Employee emp);
        [Post]
        Task<bool> Login(string name, string value);       
        [Post]
        Task<Employee> Modify([CQuery]int id, Employee body);
    }
HttpCluster httpClusterApi = new HttpClusterApi();
httpCluster.DefaultNode.Add("http://localhost:8080");
northWind = httpCluster.Create<INorthWind>();
var result = await northWind.GetEmployee(1);

Multi server

httpCluster.DefaultNode
    .Add("http://192.168.2.25:8080")
    .Add("http://192.168.2.26:8080");

Server weight

.Add("http://192.168.2.25:8080",10)
.Add("http://192.168.2.26:8080",10);
.Add("http://192.168.2.27:8080",5);

Multi url route

httpClusterApi.GetUrlNode("/order.*")
    .Add("http://192.168.2.25:8080")
    .Add("http://192.168.2.26:8080");
httpClusterApi.GetUrlNode("/employee.*")
    .Add("http://192.168.2.27:8080")
    .Add("http://192.168.2.28:8080");

github auth sample

    [FormUrlFormater]
    [Host("https://github.com")]
    public interface IGithubAuth
    {

        [Get(Route = "login/oauth/access_token")]
        Task<string> GetToken(string client_id, string client_secret, string code);

        [Host("https://api.github.com")]
        [CHeader("User-Agent", "beetlex.io")]
        [Get(Route = "user")]
        Task<string> GetUser(string access_token);
    }
     githubAuth = HttpApiClient.Create<IGithubAuth>();

Websocket

Create wsclient

TextClient client = new TextClient("ws://echo.websocket.org");

send text

 await client.Send("hello");

send and receive

var resutl = await wss.ReceiveFrom("hello henry");
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].