query-parameters

How to build a Laravel route that requires a specific URL query parameter?

允我心安 提交于 2019-12-05 09:27:46
Let's say I have URLs like this: localhost/ admin/users/ <--- Main Admin Users page localhost/ admin/users/?data=refresh <---- A typical ajax request made from that page And a simple controller like this: class UsersController extends Controller { public function index() // call some services // return a view } public function dataRefresh { // call some services // return some JSON } } And here's my routes.php I'm working on: Route::get('admin/users', array('as' => 'admin.users', 'uses' => 'Admin\Users\UsersController@index')); Route::get('admin/users????' , array('before' => 'ajax', 'as' =>

JAX-RS and unknown query parameters

时光总嘲笑我的痴心妄想 提交于 2019-12-05 06:43:31
I have a Java client that calls a RESTEasy (JAX-RS) Java server. It is possible that some of my users may have a newer version of the client than the server. That client may call a resource on the server that contains query parameters that the server does not know about. Is it possible to detect this on the server side and return an error? I understand that if the client calls a URL that has not been implemented yet on the server, the client will get a 404 error, but what happens if the client passes in a query parameter that is not implemented (e.g.: ?sort_by=last_name )? Is it possible to

How to get all GET request query parameters into a structure in Go?

谁说我不能喝 提交于 2019-12-05 06:25:36
Hi I want to transform get query parameters into a structure in Go, for example I have this structure: type Filter struct { Offset int64 `json:"offset"` Limit int64 `json:"limit"` SortBy string `json:"sortby"` Asc bool `json:"asc"` //User specific filters Username string `json:"username"` First_Name string `json:"first_name"` Last_Name string `json:"last_name"` Status string `json:"status"` } And I have the optional parameters that the user can specify when sending a get request which are Offset , Limit , SortBy , Asc , Username , First_Name , Last_Name , Status . If those parameters were sent

When to use a routing rule vs query string parameters with asp.net mvc

梦想与她 提交于 2019-12-05 05:37:33
We're considering moving forward with a ASP.NET MVC project and the subject of routing versus parameters came up. Seeing as how you can easily set up either or a combination of both in ASP.NET MVC, are there any considerations that I should be aware of when using one or the other? amurra I would recommend keeping your URL's as clean as possible and to try and use routes whenever possible. You should try and make RESTful URI's that will convey information to the user. For example: www.yourdomain.com/Products/Sports/Clothing is a lot cleaner than www.yourdomain.com/Products?Department=Sports

On query parameters change, route is not updating

血红的双手。 提交于 2019-12-04 12:36:54
In my application, there are multiple links in which I have some links with the same route but with different query parameters . say, I have links like: .../deposits-withdrawals .../deposits-withdrawals?id=1 .../deposits-withdrawals?id=2&num=12321344 When I am in one of the above routes and native to the other route from above mentioned, the route is not changing. Not even any of the functions like ngOnInit or ngOnChanges being called.I have changed the parameters from queryParameters to matrixParameters but with no success. I have gone through many links and answers. But, none of them solved

How to Filter Items By Category, queryParams in Angular 2 or 4

不羁的心 提交于 2019-12-04 11:39:59
How can I get filter by category to work on an Angular component with a list of Products? Here's what my product model looks like: export interface Product { id: number; categoryId: number; } Getting products from the service looks like this: // Products from the API getProducts(categoryId?: number): void { if (categoryId) { this.productService.getProducts() .then(products => this.products = products); this.products.filter((product: Product) => { product.categoryId === categoryId; }); } else { this.productService.getProducts() .then(products => this.products = products); } } And Query Params

How to set query parameters to url Angular2?

送分小仙女□ 提交于 2019-12-04 08:57:36
问题 I have a requirement to set a url with query parameters like /Questions?id=1234&pageid=0 . I have tried to do it via router.Navigate['/Questions?id=1234&pageid=0'] but no luck. After navigation browser shows like /Questions%3Fid%3D1234%26pageid%3D0 . I have also tried it with setting routerLink="/Questions?id=1234&pageid=0" , but same result. Please suggest any solution to do it.I am using rc5 for angular2 . 回答1: You can pass them as item in the router, but outside the commands array:

Angular: append query parameters to URL

瘦欲@ 提交于 2019-12-03 07:11:57
问题 Im using this: import { HttpParams } from '@angular/common/http'; let params = new HttpParams(); params.append('newOrdNum','123'); But this is not working, i dont append param in url. Any suggestion? 回答1: This could be archived by using the Router class: Using a component: import { Router, ActivatedRoute } from '@angular/router'; @Component({}) export class FooComponent { constructor( private _route: ActivatedRoute, private _router: Router ){} navigateToFoo(){ // changes the route without

AngularJS - Using $resource.query with params object

风流意气都作罢 提交于 2019-12-03 03:38:28
问题 I'm trying to pick up angular.js and working on figuring out some of the things that are a bit less documented. Consider this - I have a search method on the server that accepts query params and returns a collection of search results, and responds to GET /search.json route (Rails FWIW). So with jQuery , a sample query would look like this: $.getJSON('/search', { q: "javascript", limit: 10 }, function(resp) { // resp is an array of objects: [ { ... }, { ... }, ... ] }); I'm trying implement

Angular: append query parameters to URL

杀马特。学长 韩版系。学妹 提交于 2019-12-03 02:31:51
Im using this: import { HttpParams } from '@angular/common/http'; let params = new HttpParams(); params.append('newOrdNum','123'); But this is not working, i dont append param in url. Any suggestion? Jota.Toledo This could be archived by using the Router class: Using a component: import { Router, ActivatedRoute } from '@angular/router'; @Component({}) export class FooComponent { constructor( private _route: ActivatedRoute, private _router: Router ){} navigateToFoo(){ // changes the route without moving from the current view or // triggering a navigation event, this._router.navigate([], {