-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from aakash0017/master
merge
- Loading branch information
Showing
7 changed files
with
132 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"metadata": { | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.5" | ||
}, | ||
"orig_nbformat": 2, | ||
"kernelspec": { | ||
"name": "python385jvsc74a57bd00f9d6a5aaa2a7fee61cf68aafdfcdaf325adf07b0836eaa1104723ace1c314f3", | ||
"display_name": "Python 3.8.5 64-bit ('base': conda)" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2, | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import requests\n", | ||
"\n", | ||
"# url = 'http://localhost:1337/tests'\n", | ||
"# myobj = {'Name': 'nidhir test1',\n", | ||
"# 'Email': '[email protected]',\n", | ||
"# 'Phoneno': 8384041898\n", | ||
"# }\n", | ||
"\n", | ||
"# x = requests.post(url, data = myobj, headers = {\n", | ||
"\n", | ||
"# \"Authorization\": f\"Bearer {aakash_jwt}\"}\n", | ||
"# )\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"aakash_jwt = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwODY1ZDUxMDZiZWQyZDhlYzZjNmJjNyIsImlhdCI6MTYxOTQxODU1OSwiZXhwIjoxNjIyMDEwNTU5fQ.Y52bTH80hazoVPomjX9jyE4LyyOKkEnZIRjAwgPeIuY\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"url = 'http://localhost:1337/tests'\n", | ||
"myobj = {'Name': 'nidhir test1',\n", | ||
" 'Email': '[email protected]',\n", | ||
" 'Phoneno': 8384041898\n", | ||
"}\n", | ||
"\n", | ||
"x = requests.get(url, headers = {\n", | ||
"\n", | ||
" \"Authorization\": f\"Bearer {aakash_jwt}\"}\n", | ||
")\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "execute_result", | ||
"data": { | ||
"text/plain": [ | ||
"list" | ||
] | ||
}, | ||
"metadata": {}, | ||
"execution_count": 7 | ||
} | ||
], | ||
"source": [ | ||
"type(x.json())" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"myobj = {'Name': 'nidhir test1',\n", | ||
" 'Email': '[email protected]',\n", | ||
" 'Phoneno': 8384041898\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
] | ||
} |
Empty file.
Empty file.
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,18 @@ | ||
import requests | ||
|
||
aakash_jwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwODY1ZDUxMDZiZWQyZDhlYzZjNmJjNyIsImlhdCI6MTYxOTQxODU1OSwiZXhwIjoxNjIyMDEwNTU5fQ.Y52bTH80hazoVPomjX9jyE4LyyOKkEnZIRjAwgPeIuY" | ||
|
||
|
||
def get_request(endpoint, environment = 'local', url = 'http://localhost:1337/'): | ||
|
||
url = url + endpoint | ||
res = requests.get(url, headers = {"Authorization": f"Bearer {aakash_jwt}"}) | ||
return res.json() | ||
|
||
|
||
def post_request(endpoint, body, environment = 'local', url = 'http://localhost:1337/'): | ||
|
||
url = url + endpoint | ||
res = requests.post(url, data = body, headers = {"Authorization": f"Bearer {aakash_jwt}"} ) | ||
return res.json() | ||
|
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 was deleted.
Oops, something went wrong.