Skip to content

alex-cova/StringRequest

Repository files navigation

StringRequest

Send http request in a declarative way

Simple and Elegant

POST

"/login".POST(LoginDto(user: user, secret: pass)) { response in
        print(response)
    }

GET

"/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()

About

Send http request in a declarative way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages