mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-03 04:38:38 -04:00
Stop using form elements for API
Just send the JSON as the request body
This commit is contained in:
@ -21,19 +21,19 @@ func newSession(user *User) (*http.Client, error) {
|
||||
client = *server.Client()
|
||||
client.Jar = jar
|
||||
|
||||
create(&client, user, &u, "/v1/sessions/", "user")
|
||||
create(&client, user, &u, "/v1/sessions/")
|
||||
|
||||
return &client, nil
|
||||
}
|
||||
|
||||
func getSession(client *http.Client) (*handlers.Session, error) {
|
||||
var s handlers.Session
|
||||
err := read(client, &s, "/v1/sessions/", "session")
|
||||
err := read(client, &s, "/v1/sessions/")
|
||||
return &s, err
|
||||
}
|
||||
|
||||
func deleteSession(client *http.Client) error {
|
||||
return remove(client, "/v1/sessions/", "session")
|
||||
return remove(client, "/v1/sessions/")
|
||||
}
|
||||
|
||||
func sessionExistsOrError(c *http.Client) error {
|
||||
|
Reference in New Issue
Block a user