diff --git a/lib/codegen/python/pkg_http_client.dart b/lib/codegen/python/pkg_http_client.dart index 22e93299..1be3f34d 100644 --- a/lib/codegen/python/pkg_http_client.dart +++ b/lib/codegen/python/pkg_http_client.dart @@ -24,7 +24,7 @@ print(data.decode("utf-8")) result += """headers = {\n'Content-Type':'${requestModel.requestBodyContentType == ContentType.json ? 'application/json' : 'text/plain'}'\n${addHeaders(requestModel)}},\n"""; 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; return result; diff --git a/test/codegen/python_http_client_codegen_test.dart b/test/codegen/python_http_client_codegen_test.dart index a665f6d3..c944a90b 100644 --- a/test/codegen/python_http_client_codegen_test.dart +++ b/test/codegen/python_http_client_codegen_test.dart @@ -21,7 +21,7 @@ payload = json.dumps() headers = { 'Content-Type':'application/json' }, -conn.request("GET", "/todos/1", payload, headers)} +conn.request("GET", "/todos/1", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -45,7 +45,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1}) headers = { 'Content-Type':'application/json' }, -conn.request("POST", "/todos", payload, headers)} +conn.request("POST", "/todos", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -69,7 +69,7 @@ payload = json.dumps({"title": "foo","body": "bar","userId": 1}) headers = { 'Content-Type':'application/json' }, -conn.request("DELETE", "/todos/1", payload, headers)} +conn.request("DELETE", "/todos/1", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -91,7 +91,7 @@ payload = json.dumps() headers = { 'Content-Type':'application/json' }, -conn.request("HEAD", "/todos/1", payload, headers)} +conn.request("HEAD", "/todos/1", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) @@ -124,7 +124,7 @@ headers = { 'Custom-Header-1':'Value-1', 'Custom-Header-2':'Value-2', }, -conn.request("GET", "/posts?userId=1", payload, headers)} +conn.request("GET", "/posts?userId=1", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))