mirror of
https://github.com/foss42/apidash.git
synced 2025-06-06 19:38:58 +08:00
Revert "Fixed the typo for incorrect codegen"
This reverts commit 341432457182b20400006f41e8813d9d98014e02.
This commit is contained in:
@ -24,7 +24,7 @@ print(data.decode("utf-8"))
|
|||||||
result +=
|
result +=
|
||||||
"""headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n""";
|
"""headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n""";
|
||||||
result +=
|
result +=
|
||||||
"conn.request(\"${requestModel.method.name.toUpperCase()}\", \"${getUrl(requestModel)["endpoint"]}${addQueryParams(requestModel)}\", payload, headers)\n";
|
"conn.request(\"${requestModel.method.name.toUpperCase()}\", \"${getUrl(requestModel)["endpoint"]}${addQueryParams(requestModel)}\", payload, headers)}\n";
|
||||||
result += footerSnippet;
|
result += footerSnippet;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -21,7 +21,7 @@ payload = json.dumps()
|
|||||||
headers = {
|
headers = {
|
||||||
'Content-Type':'application/json'
|
'Content-Type':'application/json'
|
||||||
},
|
},
|
||||||
conn.request("GET", "/todos/1", payload, headers)
|
conn.request("GET", "/todos/1", payload, headers)}
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
data = res.read()
|
data = res.read()
|
||||||
print(data.decode("utf-8"))
|
print(data.decode("utf-8"))
|
||||||
@ -45,7 +45,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1})
|
|||||||
headers = {
|
headers = {
|
||||||
'Content-Type':'application/json'
|
'Content-Type':'application/json'
|
||||||
},
|
},
|
||||||
conn.request("POST", "/todos", payload, headers)
|
conn.request("POST", "/todos", payload, headers)}
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
data = res.read()
|
data = res.read()
|
||||||
print(data.decode("utf-8"))
|
print(data.decode("utf-8"))
|
||||||
@ -69,7 +69,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1})
|
|||||||
headers = {
|
headers = {
|
||||||
'Content-Type':'application/json'
|
'Content-Type':'application/json'
|
||||||
},
|
},
|
||||||
conn.request("DELETE", "/todos/1", payload, headers)
|
conn.request("DELETE", "/todos/1", payload, headers)}
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
data = res.read()
|
data = res.read()
|
||||||
print(data.decode("utf-8"))
|
print(data.decode("utf-8"))
|
||||||
@ -91,7 +91,7 @@ payload = json.dumps()
|
|||||||
headers = {
|
headers = {
|
||||||
'Content-Type':'application/json'
|
'Content-Type':'application/json'
|
||||||
},
|
},
|
||||||
conn.request("HEAD", "/todos/1", payload, headers)
|
conn.request("HEAD", "/todos/1", payload, headers)}
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
data = res.read()
|
data = res.read()
|
||||||
print(data.decode("utf-8"))
|
print(data.decode("utf-8"))
|
||||||
@ -124,7 +124,7 @@ headers = {
|
|||||||
'Custom-Header-1':'Value-1',
|
'Custom-Header-1':'Value-1',
|
||||||
'Custom-Header-2':'Value-2',
|
'Custom-Header-2':'Value-2',
|
||||||
},
|
},
|
||||||
conn.request("GET", "/posts?userId=1", payload, headers)
|
conn.request("GET", "/posts?userId=1", payload, headers)}
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
data = res.read()
|
data = res.read()
|
||||||
print(data.decode("utf-8"))
|
print(data.decode("utf-8"))
|
||||||
|
Reference in New Issue
Block a user