query-parameters

Why doesn't System.Uri recognize query parameter for local file path?

爷,独闯天下 提交于 2019-12-01 03:47:44
I need to add some additional query information to file path as query parameter to parse path later during files processing. I though that System.Uri class can help me with this, but it looks like it doesn't give me what I expected for local file paths. var fileUri = new Uri("file:///c://a.txt?select=10") // fileUri.AbsoluteUri = "file:///c://a.txt%3Fselect=10" // fileUri.Query = "" var httpUri = new Uri("http://someAddress/a.txt?select=10") // httpUri.AbsoluteUri = "http://someaddress/a.txt?select=10" // httpUri.Query = "?select=10" In the case of "ftp://someAddress/a.txt?select=10" - query

Query parameters with url_for?

こ雲淡風輕ζ 提交于 2019-11-30 16:54:08
url_for([:edit, @post]) is working and generating /comments/123/edit . Now I need to add a query parameter, so that instead of /comments/123/edit it is /comments/123/edit?qp=asdf I tried url_for([:edit, @post], :qp => "asdf") but no go. Use named routes. edit_post_path(@post, :qp => "asdf") You can use polymorphic_path polymorphic_path([:edit, @post], :qp => 'asdf') You can pass params to url_for . Checkout it in the sourcecode: https://github.com/rails/rails/blob/d891c19066bba3a614a27a92d55968174738e755/actionpack/lib/action_dispatch/routing/route_set.rb#L675 Michael Smart The answer from

In angular 2 how to preserve query params and add additional query params to route

会有一股神秘感。 提交于 2019-11-30 06:03:35
For example I am on route /cars?type=coupe and I want to navigate to the same endpoint with additional query params (but keeping existing one). I am trying something like this <a [routerLink]="['/cars']" [queryParams]="{model: 'renault'}" preserveQueryParams>Click</a> The initial query params are preserved (type=cars) but added ones (model=renault) are ignored. Is this expected/correct behavior or is some kind of bug? Looks like preserveQueryParams has priority over queryParams? Is there any other smooth solution? In Angular 4+, preserveQueryParams have been deprecated in favor of

How to extract query parameters with ui-router for AngularJS?

拟墨画扇 提交于 2019-11-29 22:02:03
How do I extract query parameters using ui-router for AngularJS? In AngularJS' own $location service I did: ($location.search()).uid to extract the parameter uid from a URL. What is the corresponding code for ui-router? Unless you're binding to the query parameters (see the documentation), you don't access them directly through $state or $stateParams . Use the $location service. EDIT: Per the docs , if you want to capture query parameters in $stateParams , you can append a ? to your url , and name each query parameter, separated by & , i.e. url: "/foo?bar&baz" . thisgeek See the query

How can I set a query parameter in AngularJS without doing a route?

。_饼干妹妹 提交于 2019-11-29 18:59:17
My Angular app allows the user to load an item, and when that happens I'd like to set a query string that contains the item's Id so that if the user refreshes the page (or wants to link to it), the URL is already set (there's already code in place that loads the item if the Id is present in $routeParams). How can I set that query parameter without causing a route? There are other things on the page that will get reset (including a plugin that will have to reload all of its data) if a route happens, so it's important that just the query parameter changes. In short, when I load item 123, all I

Passing an Array to a SQL query using Java's PreparedStatement

岁酱吖の 提交于 2019-11-29 17:23:11
I've been having a little trouble passing an array into a SQL query using Java's prepared statements. I had first tried the sourceforge driver, however I would get the AbstractMethodError when I call setArray method. Not knowing the solution to that I swapped to the Microsoft sqlserver driver, but now I get a different error entirely, which is "java.sql.SQLFeatureNotSupportedException: This operation is not supported." Tried a whole bunch of things to try and resolve this but nothing appears to work. My Java code looks similar to examples I've seen here and on the internet, and is as follows,

Use object type query param in swagger documentation

ⅰ亾dé卋堺 提交于 2019-11-29 14:03:46
I have a GET route where I would like to encode an object parameter in the url as a query string. When writing the swagger documentation I basically get errors that disallow me to use schema / object types in a query type parameter: paths: /mypath/: get: parameters - in: path name: someParam description: some param that works required: true type: string format: timeuuid #good param, works well - $ref: "#/parameters/mySortingParam" #this yields an error parameters: mySortingParam name: paging in: query description: Holds various paging attributes required: false schema: type: object properties:

Trailing slash before a query string. Bad practice?

*爱你&永不变心* 提交于 2019-11-29 06:19:32
I have a URL like www.example.com/store/ , which leads to a store page When a user clicks on a discount link, it adds the parameter ?discount=foo , so my link looks like this: www.example.com/store/?discount=foo . Everything is functional. But is it bad practice to have the forward slash before the query string in this situation? It’s valid: The path component may end with a slash ( / ). The query component starts with the first question mark ( ? ) in the URI. 来源: https://stackoverflow.com/questions/29855027/trailing-slash-before-a-query-string-bad-practice

In angular 2 how to preserve query params and add additional query params to route

淺唱寂寞╮ 提交于 2019-11-29 05:25:48
问题 For example I am on route /cars?type=coupe and I want to navigate to the same endpoint with additional query params (but keeping existing one). I am trying something like this <a [routerLink]="['/cars']" [queryParams]="{model: 'renault'}" preserveQueryParams>Click</a> The initial query params are preserved (type=cars) but added ones (model=renault) are ignored. Is this expected/correct behavior or is some kind of bug? Looks like preserveQueryParams has priority over queryParams? Is there any

How to extract query parameters with ui-router for AngularJS?

巧了我就是萌 提交于 2019-11-28 18:16:24
问题 How do I extract query parameters using ui-router for AngularJS? In AngularJS' own $location service I did: ($location.search()).uid to extract the parameter uid from a URL. What is the corresponding code for ui-router? 回答1: Unless you're binding to the query parameters (see the documentation), you don't access them directly through $state or $stateParams . Use the $location service. EDIT: Per the docs, if you want to capture query parameters in $stateParams , you can append a ? to your url ,