Skip to content

Instantly share code, notes, and snippets.

View hiteshjoshi's full-sized avatar
🎯
Focusing

Hitesh Joshi hiteshjoshi

🎯
Focusing
View GitHub Profile
@hiteshjoshi
hiteshjoshi / httputils.py
Created May 7, 2019 11:06 — forked from rizkyabdilah/httputils.py
simple wrapper for httplib, provide simple High Level API trough python httplib
import re
import urllib
import httplib
import mimetypes
import os
regex_url = re.compile("^(?:(?P<scheme>http|ftps?):\/\/)?(?:(?:(?P<username>[\w\.\-\+%!$&'\(\)*\+,;=]+):*(?P<password>[\w\.\-\+%!$&'\(\)*\+,;=]+))@)?(?P<host>[a-z0-9-]+(?:\.[a-z0-9-]+)*(?:\.[a-z\.]{2,6})+)(?:\:(?P<port>[0-9]+))?(?P<path>\/(?:[\w_ \/\-\.~%!\$&\'\(\)\*\+,;=:@]+)?)?(?:\?(?P<query>[\w_ \-\.~%!\$&\'\(\)\*\+,;=:@\/]*))?(?:(?P<fragment>#[\w_ \-\.~%!\$&\'\(\)\*\+,;=:@\/]*))?$")
def parse_url(url):
match = re.match(regex_url, url, re.IGNORECASE)

Keybase proof

I hereby claim:

  • I am hiteshjoshi on github.
  • I am hiteshj (https://keybase.io/hiteshj) on keybase.
  • I have a public key ASAExxh2N001dm4F6Dx9YviDSxhQRytF-AQPejWw14Q4Wgo

To claim this, I am signing this object: