Created
May 9, 2019 02:08
-
-
Save Anakin-Hao/12bc8514aaa1d3592fa420678d09b9f8 to your computer and use it in GitHub Desktop.
Infinispan REST API test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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