Skip to content

Commit e70f552

Browse files
Fix path params uri unescape (#28)
* init * Update src/client.jl --------- Co-authored-by: Tanmay Mohapatra <[email protected]>
1 parent 89c76e6 commit e70f552

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function prep_args(ctx::Ctx)
260260
body = to_json(ctx.body)
261261
elseif ("application/x-www-form-urlencoded" == ctx.header["Content-Type"]) && isa(ctx.body, Dict)
262262
body = URIs.escapeuri(ctx.body)
263-
elseif isa(ctx.boody, APIModel) && isempty(get(ctx.header, "Content-Type", ""))
263+
elseif isa(ctx.body, APIModel) && isempty(get(ctx.header, "Content-Type", ""))
264264
headers["Content-Type"] = "application/json"
265265
body = to_json(ctx.body)
266266
else
@@ -335,7 +335,7 @@ function do_request(ctx::Ctx, stream::Bool=false; stream_to::Union{Channel,Nothi
335335
# prepare the url
336336
resource_path = replace(ctx.resource, "{format}"=>"json")
337337
for (k,v) in ctx.path
338-
resource_path = replace(resource_path, "{$k}"=>v)
338+
resource_path = replace(resource_path, "{$k}"=>escapeuri(v))
339339
end
340340
# append query params if needed
341341
if !isempty(ctx.query)

0 commit comments

Comments
 (0)