-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the option to create an csh session
- Loading branch information
Tom Gebhardt
authored and
Tom Gebhardt
committed
Oct 24, 2023
1 parent
fddbf0d
commit f3267e2
Showing
7 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,3 @@ def csh_study() -> Score: #metadata, schema_version | |
print("?") | ||
return score | ||
|
||
print("Checki-di-check-check") |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import requests | ||
import json | ||
|
||
print("TESTING THE SERVER") | ||
|
||
# Define the URL of the local server | ||
url = 'http://localhost:8000/session' | ||
|
||
# Define the data you want to send in the POST request (as a dictionary) | ||
metadata = { | ||
"k1": "v1", | ||
"k2": "v2" | ||
} | ||
|
||
body = { | ||
'subject_type': 'csh', # Make sure subject_type is provided | ||
'metadata': json.dumps(metadata) | ||
} | ||
|
||
|
||
# Send an HTTP POST request with JSON content | ||
response = requests.post(url, data=body) | ||
|
||
# Check the response | ||
if response.status_code == 200: | ||
print("Request was successful.") | ||
print("Response:", response.json()) | ||
else: | ||
print("Request failed with status code:", response.status_code) | ||
print(response.text) |