Questions tagged [url-template]

8 questions
7
votes
1 answer

how to use URI templates to change path parameters in a URL in java

I followed the tutorial available in here for replacing path parameters with given values and ran the sample code which is given below import org.glassfish.jersey.uri.UriTemplate; import javax.ws.rs.core.UriBuilder; import java.net.URI; import…
Kasun Siyambalapitiya
  • 3,956
  • 8
  • 38
  • 58
5
votes
3 answers

Failed to load .html in Angular 2.0.0 testing

I have a problem with TestBed in Angular 2.0.0 beforeEach( async(() => { TestBed.configureTestingModule({ declarations: [ SomethingComponent ] }).compileComponents(); // compile template …
Janett Holst
  • 146
  • 1
  • 5
3
votes
1 answer

Web api routing: optional parameters

I have this route: routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}/{myparam}", defaults: new { id = RouteParameter.Optional, myparam = RouteParameter.Optional } …
user437899
  • 8,879
  • 13
  • 51
  • 71
2
votes
1 answer

Accessing $state outside angularjs

I have an angularjs application. The app is supposed to be a hybrid mobile app for android and iOS. I have a JavaScript file in the project which is not a part of any module. In that JavaScript file I need to call the respective template URL, either…
arqam
  • 3,582
  • 5
  • 34
  • 69
1
vote
1 answer

Is "/literal/{param}/literal" a valid url template for a WCF restful service

I am trying to add a new endpoint to a WCF based REST service with the following URL template: /books/{bookId}/pdf but it gives an error saying: The UriTemplate '/books/*/pdf' is not valid; the wildcard ('*') cannot appear in a variable name or…
A9S6
  • 6,575
  • 10
  • 50
  • 82
1
vote
1 answer

Creating route-based templated hrefs with ASP.NET Web API

Adding links to resource representations is really easy to do within a Web API controller. Using the controller's Url property (which is of UrlHelper class) you can build the href of a link using route names, like this: var href =…
biscuit314
  • 2,384
  • 2
  • 21
  • 29
1
vote
1 answer

RFC 6570 URL Templates : the role of / vs. other prefixes

I recently read some of : https://www.rfc-editor.org/rfc/rfc6570#section-1 And I found the following URL template examples : GIVEN : var="value"; x=1024; path=/foo/bar; {/var,x}/here /value/1024/here {#path,x}/here …
jayunit100
  • 17,388
  • 22
  • 92
  • 167
0
votes
0 answers

System.UriTemplate.BindByName and WebApi Array Binding

I am using UriTemplate (System.ServiceModel) to bind a template to an object and create a url var baseUri = new Uri("http://example.com"); var template = new UriTemplate(""); var properties = new NameValueCollection { {"a", "1"}, {"a",…
Anthony Johnston
  • 9,405
  • 4
  • 46
  • 57