@@ -85,7 +85,7 @@ class DerivaBinding {
8585 /// returns the server cookie token.
8686 Future <String > _postAuthnSession () async {
8787 // Post credential to the server
88- var response = await client.post ('https://${this .hostname }/authn/session' , body: credential);
88+ var response = await client.post (Uri . parse ( 'https://${this .hostname }/authn/session' ) , body: credential);
8989 if (response.statusCode != 200 ) {
9090 throw http.ClientException ('Authentication Failure: ${response .body }' );
9191 }
@@ -128,7 +128,7 @@ class DerivaBinding {
128128 throw ArgumentError ("Invalid path: null or '' not allowed" );
129129 }
130130
131- var response = await client.get ('https://${hostname }${path }' , headers: headers);
131+ var response = await client.get (Uri . parse ( 'https://${hostname }${path }' ) , headers: headers);
132132 if (response.statusCode < 200 || response.statusCode >= 300 ) {
133133 throw http.ClientException ('Failed to get "${path }": ${response .body }' );
134134 }
@@ -139,7 +139,7 @@ class DerivaBinding {
139139 Future <Object > post (String path, {Object data, Map <String , String > headers}) async {
140140 headers = await _updateAuthorizationHeader (headers);
141141
142- var response = await client.post ('https://${hostname }${path }' , body: data, headers: headers);
142+ var response = await client.post (Uri . parse ( 'https://${hostname }${path }' ) , body: data, headers: headers);
143143 if (response.statusCode < 200 || response.statusCode >= 300 ) {
144144 throw http.ClientException ('Failed to post "${path }": ${response .body }' );
145145 }
@@ -150,7 +150,7 @@ class DerivaBinding {
150150 Future <Object > put (String path, {Object data, Map <String , String > headers}) async {
151151 headers = await _updateAuthorizationHeader (headers);
152152
153- var response = await client.put ('https://${hostname }${path }' , body: data, headers: headers);
153+ var response = await client.put (Uri . parse ( 'https://${hostname }${path }' ) , body: data, headers: headers);
154154 if (response.statusCode < 200 || response.statusCode >= 300 ) {
155155 throw http.ClientException ('Failed to post "${path }": ${response .body }' );
156156 }
@@ -171,7 +171,7 @@ class DerivaBinding {
171171 throw ArgumentError ("Invalid path: null or '' not allowed" );
172172 }
173173
174- var response = await client.delete ('https://${hostname }${path }' , headers: headers);
174+ var response = await client.delete (Uri . parse ( 'https://${hostname }${path }' ) , headers: headers);
175175 if (response.statusCode < 200 || response.statusCode >= 300 ) {
176176 throw http.ClientException ('Failed to delete "${path }": ${response .body }' );
177177 }
0 commit comments