Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 651 Bytes

README.md

File metadata and controls

49 lines (36 loc) · 651 Bytes

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