Answers for "flutter use query in http request"

1

flutter use query in http request

var queryParameters = {
  'param1': 'one',
  'param2': 'two',
};
var uri =
    Uri.https('www.myurl.com', '/api/v1/test/${widget.pk}', queryParameters);
var response = await http.get(uri, headers: {
  HttpHeaders.authorizationHeader: 'Token $token',
  HttpHeaders.contentTypeHeader: 'application/json',
});
Posted by: Guest on November-20-2020

Code answers related to "flutter use query in http request"

Browse Popular Code Answers by Language