Dart Language: Get URI query parameters without server port -


the dart documentation focuses on processing http requests on specific server port. if server listening on port 4123, should fine sending get, post or other requests uri like:

http://www.somedomain.com:4123/?q=something 

however, query parameters sent server/domain without specifying server port not handled, like:

http://www.somedomain.com/?q=something 

so should handle query parameters sent server (address/domain) without specifying server port?

edit 1:

some possible solution implement "uri checker" @ main method , retrieve query (if it's present), so:

import 'dart:html';  void main() {      // gets uri in order check parameters.     var uri = uri.parse(window.location.href);      // check parameter presence in uri.     if (uri.queryparameters["q"] != null) {          // gets parameter content , stores it.         var queryparamcontent = uri.queryparameters["q"];          // check if parameter content empty or not.         if (queryparamcontent.isnotempty) {             // query parameter.         } else {             // warn user empty query.         }     } else {         // there's nothing interesting check in uri.     } } 

if doesn't work without port create bug report @ http://dartbug.com/new.

as workaround can use port 80 default value when no specific port set.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -