Skip to content

Instantly share code, notes, and snippets.

View luzemin's full-sized avatar
🏠
Working from home

luzemin luzemin

🏠
Working from home
View GitHub Profile
@markekraus
markekraus / HttpClient-Example.ps1
Created November 25, 2020 21:03
Example using HttpClient in PowerShell
# Create single HttpClient
$client = [System.Net.Http.HttpClient]::new()
# Perform multiple GETs
foreach ($url in $urls) {
$clientResult = $client.GetStringAsync($url).
GetAwaiter().
GetResult()
$clientResult | ConvertFrom-Json
}
@preethamhegdes
preethamhegdes / OkHttpUtil.java
Last active October 19, 2024 03:24
OkHttp Client Ignore certificate
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.net.*;
import java.security.cert.CertificateException;
/*
okhttp version used 3.8.1
if (-not ("Windows.Native.Kernel32" -as [type]))
{
Add-Type -TypeDefinition @"
namespace Windows.Native
{
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {