Request string without GET arguments [duplicate]

Edit: @T.Todua provided a newer answer to this question using parse_url. (please upvote that answer so it can be more visible). Edit2: Someone has been spamming and editing about extracting scheme, so I’ve added that at the bottom. parse_url solution The simplest solution would be: echo parse_url($_SERVER[“REQUEST_URI”], PHP_URL_PATH); Parse_url is a built-in php function, who’s … Read more

Standardized way to serialize JSON to query string?

URL-encode (https://en.wikipedia.org/wiki/Percent-encoding) your JSON text and put it into a single query string parameter. for example, if you want to pass {“val”: 1}: mysite.com/path?json=%7B%22val%22%3A%201%7D Note that if your JSON gets too long then you will run into a URL length limitation problem. In which case I would use POST with a body (yes, I know, … Read more

Passing multiple values for a single parameter in Reporting Services

Although John Sansom’s solution works, there’s another way to do this, without having to use a potentially inefficient scalar valued UDF. In the SSRS report, on the parameters tab of the query definition, set the parameter value to =join(Parameters!<your param name>.Value,”,”) In your query, you can then reference the value like so: where yourColumn in … Read more

What characters must be escaped in an HTTP query string?

The answer lies in the RFC 3986 document, specifically Section 3.4. The query component is indicated by the first question mark (“?”) character and terminated by a number sign (“#”) character or by the end of the URI. … The characters slash (“/”) and question mark (“?”) may represent data within the query component. Technically, … Read more

Parse a string as if it were a querystring in Ruby on Rails

The answer depends on the version of Rails that you are using. If you are using 2.3 or later, use Rack’s builtin parser for params Rack::Utils.parse_nested_query(“a=2”) #=> {“a” => “2”} If you are on older Rails, you can indeed use CGI::parse. Note that handling of hashes and arrays differs in subtle ways between modules so … Read more

node.js http ‘get’ request with query string parameters

Check out the request module. It’s more full featured than node’s built-in http client. var request = require(‘request’); var propertiesObject = { field1:’test1′, field2:’test2′ }; request({url:url, qs:propertiesObject}, function(err, response, body) { if(err) { console.log(err); return; } console.log(“Get response: ” + response.statusCode); });

When to use query parameters versus matrix parameters?

The differences between Matrix parameters and Query Parameters are much more than just convention. The main differences are: urls with query params won’t have their response cached by intermediaries/proxies (at present) matrix parameters may appear anywhere in path calculating the relative uri is different query params are generally abused to add new verbs instead of … Read more