@@ -142,7 +142,7 @@ func (ctx *ApiCtx) Signin() error {
142142 }
143143 jsonResp := & ApiResp {}
144144
145- resp , err := ctx .Http .Post (ctx .SigninPath ).BodyJSON (ctx .Creds ).ReceiveSuccess (jsonResp )
145+ resp , err := ctx .Http .New (). Post (ctx .SigninPath ).BodyJSON (ctx .Creds ).ReceiveSuccess (jsonResp )
146146 if err != nil {
147147 return fmt .Errorf ("api signin: HTTP request creation failed: %s" , err )
148148 }
@@ -155,6 +155,7 @@ func (ctx *ApiCtx) Signin() error {
155155 }
156156
157157 ctx .Http = ctx .Http .Set ("Authorization" , jsonResp .Message )
158+
158159 log .Printf ("api signin: signed in successfuly" )
159160 return nil
160161}
@@ -164,7 +165,7 @@ func (ctx *ApiCtx) RegisterMachine(machineID string, password string) error {
164165 ctx .Creds .Password = password
165166 jsonResp := & ApiResp {}
166167
167- resp , err := ctx .Http .Post (ctx .RegisterPath ).BodyJSON (ctx .Creds ).ReceiveSuccess (jsonResp )
168+ resp , err := ctx .Http .New (). Post (ctx .RegisterPath ).BodyJSON (ctx .Creds ).ReceiveSuccess (jsonResp )
168169 if err != nil {
169170 return fmt .Errorf ("api register machine: HTTP request creation failed: %s" , err )
170171 }
@@ -185,7 +186,7 @@ func (ctx *ApiCtx) ResetPassword(machineID string, password string) error {
185186 jsonResp := & ApiResp {}
186187
187188 data := map [string ]string {"machine_id" : ctx .Creds .User , "password" : ctx .Creds .Password }
188- resp , err := ctx .Http .Post (ctx .ResetPwdPath ).BodyJSON (data ).ReceiveSuccess (jsonResp )
189+ resp , err := ctx .Http .New (). Post (ctx .ResetPwdPath ).BodyJSON (data ).ReceiveSuccess (jsonResp )
189190 if err != nil {
190191 return fmt .Errorf ("api reset password: HTTP request creation failed: %s" , err )
191192 }
0 commit comments