Skip to content

RequestLab/strapi-sdk-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

The official Strapi SDK for Swift.



Install

pod 'Strapi'

Start now

New instance

import Strapi

let strapi = Strapi(baseURL: "http://localhost:1337")

Authentications

Local

strapi.login(identifier: "username_or_email", password: "s3cr3t", success: { jwt, user in

}, failure: { error in

})

CRUD

strapi.all(entries: "articles", success: { objects in

}, failure: { error in
    
})

Files management

guard let image = UIImage(named: "image_name"), let data = UIImagePNGRepresentation(image) else {
    return
}

strapi.upload(files: [image], progress: { progress in

}, success: { objects in

}, failure: { error in

})

API

Strapi(baseURL: String)

register(username: String, email: String, password: String)

login(identifier: String, password: String)

logout()

create(entry model: String, parameters: [String, Any])

all(entries model: String)

get(entry model: String, id: String)

update(entry model: String, id: String, parameters: [String: Any])

delete(entry model: String, id: String)

files()

file(id: String)

upload(files: [Data])

Resources

Credits

License

MIT

About

πŸ”Œ Official Swift SDK for APIs built with Strapi.

Resources

License

Stars

Watchers

Forks

Packages

No packages published