How do you add query parameters to a Dart http request?

前端 未结 6 1832
广开言路
广开言路 2020-12-05 22:48

How do you correctly add query parameters to a Dart http get request? I been unable to get my request to respond correctly when trying to append the \'?param1=one¶m

6条回答
  •  广开言路
    2020-12-05 23:41

    The accepted answer didn't work for me but adding a '&' without quotes to end of the URL solves my problem. In this case, change the following line:

    String workingStringInPostman = "https://www.myurl.com/api/v1/test/123/?param1=one¶m2=two";
    

    to this: (Notice the '&' at the end).

    String workingStringInPostman = "https://www.myurl.com/api/v1/test/123/?param1=one¶m2=two&";
    

提交回复
热议问题