Skip to content

Instantly share code, notes, and snippets.

View surajkjai's full-sized avatar

Suraj Jaiswal surajkjai

View GitHub Profile

sunzoomass

Keybase proof

I hereby claim:

  • I am surajkjai on github.
  • I am sunzoomass (https://keybase.io/sunzoomass) on keybase.
  • I have a public key ASCcqj8riqwC5t0Ddt639r5RvSCvmUrMYdf7D2Qzh2-7Cgo

To claim this, I am signing this object:

@surajkjai
surajkjai / pycurl_post_o_tls.py
Last active February 12, 2023 00:11
Use pycurl to POST http data to a REST endpoint over TLS
import json
import pycurl
def pycurl_post_over_tls():
with open('data_to_read.json', 'r') as f:
url = "https://httpbin.org/post"
# load json data from the file read
json_data = json.load(f)
# stringify the json data (now json_data is dict) to be used in the POST body