In the previous part of this series, we looked at creating our first API. But how do you determine which API is being invoked? This is accomplished with routing.
If you have a Products class your entry (end point) might look like this:
[Function(nameof(Products))]
public IActionResult Run(HttpTrigger(AuthorizationLevel.Anonymous,
"get", Route="products/{category}/{id: int}")]
HttpRequest req, string category, int id)
{
return new OkObjectResult(new {category, id});
}
Notice the routing property (“products/{category}/{id: int}” — this allows us to customize and restrict the arguments from the desired endpoint. The customer/user can now use the same endpoint for a variety of situations.
You can go further and restrict the type of the parameters, and even provide default values:
Route="products/{category:alpha}/{id: int?}")]
Here we are saying that the category must consist only of standard characters, and the id is optional.
Next up: Options
Note, this material is based on our book Programming APIs with C# and .NET from Packt by Jesse Liberty and Joseph Deluzen.






































I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post…
I really like what you guys are up too. This type of clever work and reporting! Keep up the good works guys I’ve added you guys to blogroll.
We stumbled over here by a different web address and thought I might check things out. I like what I see so i am just following you. Look forward to looking into your web page yet again.
Magnificent beat ! I wish to apprentice whilst you amend your web site, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been tiny bit familiar of this your broadcast offered shiny clear concept
I?m not sure where you are getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for wonderful information I was looking for this information for my mission.
Helpful information. Lucky me I found your website by chance, and I am shocked why this coincidence didn’t came about in advance! I bookmarked it.
Enjoyed examining this, very good stuff, appreciate it.
Absolutely indited content material, regards for selective information.
Sweet website , super design, real clean and use genial.
Some genuinely superb articles on this site, regards for contribution. “Be absolutely determined to enjoy what you do.” by Sarah Knowles Bolton.
I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Outstanding work!
I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.
Perfectly pent content, Really enjoyed reading.
I like this post, enjoyed this one thank you for posting. “The difference between stupidity and genius is that genius has its limits.” by Albert Einstein.
I like this internet site because so much utile stuff on here : D.
Very nice post and right to the point. I am not sure if this is really the best place to ask but do you folks have any thoughts on where to get some professional writers? Thanks in advance 🙂
Hi there very nice site!! Guy .. Excellent .. Wonderful .. I will bookmark your web site and take the feeds additionallyKI’m satisfied to find numerous helpful info here in the post, we’d like work out extra strategies in this regard, thanks for sharing. . . . . .
Hello there, I found your site via Google while searching for a related topic, your website came up, it looks great. I’ve bookmarked it in my google bookmarks.
I believe this internet site has some really fantastic info for everyone :D. “The test of every religious, political, or educational system is the man that it forms.” by Henri Frdric Amiel.
I like this site very much, Its a very nice place to read and incur info .
I see something genuinely special in this website.
Good write-up, I¦m regular visitor of one¦s blog, maintain up the nice operate, and It is going to be a regular visitor for a lengthy time.
F*ckin’ tremendous issues here. I am very satisfied to peer your post. Thanks a lot and i am having a look ahead to touch you. Will you please drop me a e-mail?
Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.
My partner and I absolutely love your blog and find the majority of your post’s to be just what I’m looking for. Does one offer guest writers to write content for yourself? I wouldn’t mind producing a post or elaborating on a few of the subjects you write concerning here. Again, awesome weblog!
What i do not realize is if truth be told how you are no longer actually much more smartly-preferred than you might be right now. You’re so intelligent. You realize therefore significantly in terms of this subject, made me individually believe it from numerous various angles. Its like men and women are not fascinated except it’s something to accomplish with Woman gaga! Your personal stuffs nice. At all times maintain it up!
Hello There. I found your weblog the usage of msn. That is a very neatly written article. I will be sure to bookmark it and come back to read extra of your helpful info. Thanks for the post. I’ll certainly return.
I was reading through some of your blog posts on this site and I believe this website is rattling informative! Keep on posting.
Hello there, simply became aware of your weblog via Google, and located that it’s truly informative. I’m going to be careful for brussels. I’ll appreciate in the event you continue this in future. Many other people might be benefited from your writing. Cheers!
I will immediately grab your rss feed as I can not find your email subscription link or e-newsletter service. Do you have any? Please allow me realize so that I could subscribe. Thanks.
I have been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before.
I love your blog.. very nice colors & theme. Did you create this website yourself? Plz reply back as I’m looking to create my own blog and would like to know wheere u got this from. thanks
Incredible! This blog looks exactly like my old one! It’s on a totally different subject but it has pretty much the same page layout and design. Outstanding choice of colors!
I like what you guys are up too. Such intelligent work and reporting! Carry on the excellent works guys I?ve incorporated you guys to my blogroll. I think it’ll improve the value of my web site 🙂
Thanx for the effort, keep up the good work Great work, I am going to start a small Blog Engine course work using your site I hope you enjoy blogging with the popular BlogEngine.net.Thethoughts you express are really awesome. Hope you will right some more posts.
We would also like to convey that most individuals who find themselves devoid of health insurance are normally students, self-employed and people who are without a job. More than half with the uninsured are under the age of Thirty five. They do not think they are in need of health insurance because they are young plus healthy. Its income is normally spent on houses, food, as well as entertainment. Some people that do work either entire or as a hobby are not offered insurance by their work so they move without due to the rising tariff of health insurance in the United States. Thanks for the suggestions you write about through this blog.
Good write-up, I¦m normal visitor of one¦s site, maintain up the excellent operate, and It’s going to be a regular visitor for a long time.
Absolutely composed subject matter, appreciate it for information .
Some really marvellous work on behalf of the owner of this web site, perfectly outstanding subject material.
Hey, you used to write magnificent, but the last few posts have been kinda boringK I miss your super writings. Past few posts are just a little bit out of track! come on!
Thanks for some other informative web site. Where else may I am getting that type of information written in such an ideal means? I have a mission that I am just now running on, and I’ve been at the look out for such info.
This is a great page. It’s very engaging and well organized. I’ll come back from time to time for more posts like this one.
Great blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your design. Appreciate it
You actually make it appear so easy along with your presentation however I to find this topic to be really something that I think I’d never understand. It sort of feels too complicated and extremely huge for me. I’m having a look forward in your subsequent submit, I?¦ll attempt to get the dangle of it!
It?¦s actually a great and useful piece of information. I am satisfied that you shared this useful information with us. Please keep us up to date like this. Thank you for sharing.
This site is really a walk-through for all the information you wished about this and didn’t know who to ask. Glimpse here, and you’ll undoubtedly discover it.
Thanks for a marvelous posting! I really enjoyed reading it, you will be a great author.I will ensure that I bookmark your blog and will eventually come back from now on. I want to encourage you to ultimately continue your great writing, have a nice holiday weekend!
Thanks for sharing excellent informations. Your website is so cool. I am impressed by the details that you have on this site. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my friend, ROCK! I found just the information I already searched everywhere and simply couldn’t come across. What a great site.
I was just looking for this info for a while. After six hours of continuous Googleing, at last I got it in your web site. I wonder what is the lack of Google strategy that don’t rank this type of informative sites in top of the list. Generally the top websites are full of garbage.
I would like to show my appreciation to you just for rescuing me from such a difficulty. As a result of looking through the search engines and obtaining principles which are not beneficial, I thought my life was over. Living minus the strategies to the issues you’ve sorted out through the posting is a critical case, as well as the ones which might have in a negative way affected my career if I had not come across your website. That mastery and kindness in handling every aspect was invaluable. I am not sure what I would have done if I hadn’t encountered such a thing like this. I can at this time look forward to my future. Thanks for your time so much for the skilled and results-oriented help. I won’t hesitate to refer your blog post to anyone who ought to have recommendations on this situation.