Skip to content

Commit

Permalink
Show JSON responses as actual JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
finngl committed May 15, 2024
1 parent 0d23761 commit 545ea5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions new_project_from_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
from datetime import datetime
from pathlib import Path
from json import dumps

import common
from functions import new_project
Expand Down Expand Up @@ -46,5 +47,6 @@
mr_base_url=common.MICROREACT_BASE_URL,
verify = not args.noverify
)
print(f"REST response: {str(rest_response)}")
print(rest_response.json())
print(f"HTTP response code: {str(rest_response)}")
print("Response as actual JSON:")
print(dumps(rest_response.json()))
7 changes: 4 additions & 3 deletions new_project_from_mongo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
from datetime import datetime
from os import getenv
from sys import exit
from json import dumps
from string import ascii_letters,digits
from random import choice

Expand Down Expand Up @@ -107,5 +107,6 @@ def random_string(n):
mr_base_url=common.MICROREACT_BASE_URL,
verify = not args.noverify
)
print(f"REST response: {str(rest_response)}")
print(rest_response.json())
print(f"HTTP response code: {str(rest_response)}")
print("Response as actual JSON:")
print(dumps(rest_response.json()))

0 comments on commit 545ea5e

Please sign in to comment.