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
Post a Comment