Skip to content

Instantly share code, notes, and snippets.

@Anakin-Hao
Last active May 9, 2019 02:35
Show Gist options
  • Save Anakin-Hao/1ae50da9656db55f16a3238156f16914 to your computer and use it in GitHub Desktop.
Save Anakin-Hao/1ae50da9656db55f16a3238156f16914 to your computer and use it in GitHub Desktop.
Test infinispan
import requests
from requests.auth import HTTPBasicAuth
import time
headers = {'Content-Type': 'application/json', 'performAsync': 'True', 'timeToLiveSeconds': '99999999999'}
body = {'test':123}
auth=HTTPBasicAuth('test', 'changeme')
baseurl = "http://infinispan-server-http/rest"
def run():
global headers
global body
global auth
while True:
r = requests.get(f"{baseurl}/default/test", auth=auth, headers=headers, data=body, verify=False)
print(r)
print(r.json())
print(time.time())
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment