What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-20 10:41:08
how to get x-csrf-token in python
import sys import requests URL = 'https://portal.bitcasa.com/login' client = requests.session() # Retrieve the CSRF token first client.get(URL) # sets cookie if 'csrftoken' in client.cookies: # Django 1.6 and up csrftoken = client.cookies['csrft... Add solution -
TypeScript 2021-10-12 23:48:11
python requests get all cookies
>>> import requests >>> session = requests.Session() >>> print(session.cookies.get_dict()) {} >>> response = session.get('http://google.com') >>> print(session.cookies.get_dict()) {'PREF': 'ID=5514c728c9215a9a:... Add solution -
Python 2021-10-12 21:04:05
python api define bearer token
import requests endpoint = ".../api/ip" data = {"ip": "1.1.2.3"} headers = {"Authorization": "Bearer MYREALLYLONGTOKENIGOT"} print(requests.post(endpoint, data=data, headers=headers).json()) Add solution -
Other 2021-10-10 04:03:04
gradio img classify
import gradio as gr import tensorflow as tf import numpy as np import requests inception_net = tf.keras.applications.InceptionV3() # load the model # Download human-readable labels for ImageNet. response = requests.get("https://git.io/JJkYN") ... Add solution