Send http request in a declarative way
Simple and Elegant
"/login".POST(LoginDto(user: user, secret: pass)) { response in
print(response)
}
"/login".GET(LoginResponseDto.self) { response in
print(response)
}
"/user/%@/purchases?kind=%@"
.formatted(userId, 1)
.GET { response in
print(response)
}
"/user/%@"
.formatted(userId)
.GET(User.self) { response in
print(response)
}
_ = await "/user/%@/purchases?kind=%@"
.newRequest(.DELETE)
.formatted(user, 1)
.withHeader(.authorization, "Yolo")
.send()