Skip to content

Instantly share code, notes, and snippets.

View yoeven's full-sized avatar
🍁

Yoeven D Khemlani yoeven

🍁
View GitHub Profile
@yoeven
yoeven / postJSON.cs
Created October 1, 2018 07:31 — forked from manuerumx/postJSON.cs
Unity 3D example POST JSON Data to a Server with http Auth
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class goLevel : MonoBehaviour {
//With the @ before the string, we can split a long string in many lines without getting errors
private string json = @"{
'hello':'world',
'foo':'bar',
'count':25
@yoeven
yoeven / JSON_to_URLEncoded.ts
Last active July 5, 2023 07:19 — forked from lastguest/JSON_to_URLEncoded.js
Convert JavaScript object to x-www-form-urlencoded format
const JSONtoURLEncoded = (element: any, key?: string, _list?: any[]) => {
let list = _list || [];
if (typeof element == "object") {
for (let idx in element) JSONtoURLEncoded(element[idx], key ? key + "[" + idx + "]" : idx, list);
} else {
list.push(key + "=" + encodeURIComponent(element));
}
return list.join("&");
};