@@ -55,21 +55,21 @@ proc deletePet*(httpClient: HttpClient, petId: int64, apiKey: string): Response
55
55
56
56
proc findPetsByStatus* (httpClient: HttpClient, status: seq [Status]) : (Option[seq [Pet]], Response) =
57
57
# # Finds Pets by status
58
- let query_for_api_call = encodeQuery([
58
+ let url_encoded_query_params = encodeQuery([
59
59
(" status" , $ status.join(" ," )), # Status values that need to be considered for filter
60
60
])
61
61
62
- let response = httpClient.get(basepath & " /pet/findByStatus" & " ?" & query_for_api_call )
62
+ let response = httpClient.get(basepath & " /pet/findByStatus" & " ?" & url_encoded_query_params )
63
63
constructResult[seq [Pet]](response)
64
64
65
65
66
66
proc findPetsByTags* (httpClient: HttpClient, tags: seq [string ]): (Option[seq [Pet]], Response) {.deprecated.} =
67
67
# # Finds Pets by tags
68
- let query_for_api_call = encodeQuery([
68
+ let url_encoded_query_params = encodeQuery([
69
69
(" tags" , $ tags.join(" ," )), # Tags to filter by
70
70
])
71
71
72
- let response = httpClient.get(basepath & " /pet/findByTags" & " ?" & query_for_api_call )
72
+ let response = httpClient.get(basepath & " /pet/findByTags" & " ?" & url_encoded_query_params )
73
73
constructResult[seq [Pet]](response)
74
74
75
75
@@ -91,21 +91,21 @@ proc updatePet*(httpClient: HttpClient, pet: Pet): (Option[Pet], Response) =
91
91
proc updatePetWithForm*(httpClient: HttpClient, petId: int64 , name: string , status: string ): Response =
92
92
## Updates a pet in the store with form data
93
93
httpClient.headers["Content-Type " ] = " application/ x- www- form- urlencoded"
94
- let query_for_api_call = encodeQuery([
94
+ let form_data = encodeQuery([
95
95
(" name" , $ name), # Updated name of the pet
96
96
(" status" , $ status), # Updated status of the pet
97
97
])
98
- httpClient.post(basepath & fmt" /pet/{ petId} " , $ query_for_api_call )
98
+ httpClient.post(basepath & fmt" /pet/{ petId} " , $ form_data )
99
99
100
100
101
101
proc uploadFile* (httpClient: HttpClient, petId: int64 , additionalMetadata: string , file: string ): (Option[ApiResponse], Response) =
102
102
# # uploads an image
103
103
httpClient.headers[" Content-Type" ] = " multipart/form-data"
104
- let query_for_api_call = newMultipartData({
104
+ let multipart_data = newMultipartData({
105
105
" additionalMetadata" : $ additionalMetadata, # Additional data to pass to server
106
106
" file" : $ file, # file to upload
107
107
})
108
108
109
- let response = httpClient.post(basepath & fmt" /pet/{ petId} /uploadImage " , multipart= query_for_api_call )
109
+ let response = httpClient.post(basepath & fmt" /pet/{ petId} /uploadImage " , multipart= multipart_data )
110
110
constructResult[ApiResponse](response)
111
111
0 commit comments