In the post Designing Your RESTful API Part 1: The Nouns, you learned the importance of resources, request headers, and the request body when you defined your RESTful API. In this post, you will learn about the five or so request verbs and what is send back to the client in the response body and the response status code.
Everything is a resource in REST. As you learned in Choosing Between RESTful Web Service, SOAP, Representational State Transfer (REST) is an architecture style or design pattern for creating web services which allow anything connected to a network to something else on the network using Hypertext Transfer Protocol (HTTP).
In this post, you will learn the how to define your resource identifier. In the following post, you will learn how to use the HTTP verbs and response codes. And along the way you will learn many of the principles of a good RESTful API.
Let me second what As Thomas Hunter II writes:
The easier your API is to consume, the more people that will consume it.
Representational State Transfer (REST) is an architecture style or design pattern for creating web services which allow anything connected to a network to something else on the network using Hypertext Transfer Protocol (HTTP).
Typically we think of a RESTful Web Service as one that will get and set data. It works a lot the same way as a web page, but your user doesn’t see the data until it’s time to be displayed.
REST principles are based on the same underlying principles that govern the Web. Those principles are:
- User agents interact with resources, and resources are anything that can be named and represented. Each resource can be addressed via a unique Uniform Resource Identifier (URI).
- Interaction with resources (located through their unique URIs) is accomplished using a uniform interface of the HTTP standard verbs (GET, POST, PUT, and DELETE). Also important in the interaction is the declaration of the resource’s media type, which is designated using the HTTP Content-Type header. (XHTML, XML, JPG, PNG, and JSON are some well-known media types.)
- Resources are self-descriptive. All the information necessary to process a request on a resource is contained inside the request itself (which allows services to be stateless).
- Resources contain links to other resources (hyper-media).
Or your application may want to be “cloud ready” from the beginning. The vision may begin with a set of servers, each doing a specific task, each that can be scalable to meet demand, provide reliability. As soon as you take that second step, it’s time to look to well known practices.
Microsoft’s Patterns and Practices team has put together architectural guidance to help you design your cloud applications, Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications. Each pattern is provided in a common format that describes the context and problem, the solution, issues and considerations for applying the pattern, and an example based on Azure.
It also discusses the benefits and considerations for each pattern. Most of the patterns have code samples or snippets that show how to implement the patterns using the features of Microsoft Azure.
Although the guidance helps you adopt Azure, the patterns are relevant to all kinds of distributed systems, whether or not they are hosted on Azure or on other cloud platforms.
The article in ZDNet is entitled Intel CEO Krzanich unveils wearable processor Curie, but is 2015 one of those years that we look back to see it all changed? It’s a set of announcements where you can envision the possibilities of such devices. I’m imagining the devices from Intel can also fire the imagination of others, who may have actually inspired Intel.
I’m not really a processors guy. I build software at a higher level. But the kinds of software we can build begin at the processor. And when the roadmap shows that changes are coming, changes are coming.
Moving applications to the cloud provides you with a cloud infrastructure for backup and resiliency. When you move to the cloud, you move from a standard physical implementation tool, including data centers, software, hardware, networking and servers – and move to a service, where much of the infrastructure is maintained for you. Cloud offerings such as Microsoft Azure provide you with a standard configuration. If your application fits those parameters, migration is easier. Other times, the application may require particular settings in Internet Information Services.
Although not all applications will seamlessly move to the cloud, a tool from Microsoft Azure Websites Migration Assistant offers you a way to determine what challenges you may face in moving your application to Azure. The Azure Websites Migration Assistant help you migrate your on-premise app to the cloud in a few clicks.
For example, if you want to move a departmental application from Windows Server 2003 running ASP.NET 2 running a version of SQL locally, you might not think of that being a candidate for migration to the cloud.
Windows Server 2003 will reach end of support on July 14th 2015. If you are currently your websites on an IIS server that is Windows Server 2003, Azure Websites is a low-risk, low-cost, and low-friction way to keep your websites online, and Azure Websites Migration Assistant can help automate the migration process for you.
Azure Websites Migration Assistant can analyze your IIS server installation, identify which sites can be migrated to Azure Websites, highlight any elements that cannot be migrated or are unsupported on the platform, and then migrate your websites and associated databases to Azure.
Applications can be deployed to Azure Websites.
The latest version of TypeScript includes of new features in the language, compiler and associated tools. And it comes in the box as part of Visual Studio 2013 and Visual Studio 2015.
This week, Microsoft compiled a series of announcements that noted improvements and updates to its Azure platform. I wanted to call out several key new features of interest to developers and cloud development managers:
- Updates to SQL Database making it easier to migrate your applications to the cloud.
- Azure Active Directory Application Proxy allows publishing of on-premises web applications on Azure Active Directory. Through an easy and secured process, web applications hosted on-premises can now be published via Azure Active Directory. Apps allow for single sign on.
- Azure Site Recovery now has the ability to replicate and recover virtual machines (VMs) directly to Azure without requiring System Center Virtual Machine Manager.
- To help developers using Visual Studio easily incorporate the benefits of big data within their applications, we’ve added a deeper tooling experience for HDInsight in the most recent version of the Azure SDK. Developers can use this extension to visualize and query their Hadoop clusters, as well as manage applications that integrate with Hadoop directly in Visual Studio. Learn more.
This post gives you an idea of what the code looks like in ECMAScript 6. This post doesn’t cover ever feature. But you will learn about how ECMAScript 6 relates to:
- Arrow Functions and Lexical this
- Default Function Parameters
- Arrow functions
Special thanks to Axel Rauschmayer for many of the snippets.
The ES6 compatibility table is very useful, as it tells us the ES6 features that are supported in the current browser. It also gives us a handy link to the specifications for each of the features listed. You will find that the current versions of browsers are implementing these features as fast as they can. The table shows that some subset of the feature exists, so as we say, “your mileage may vary”. That said, it is coming.
I don’t have any particular insider information, but wanted to share what I am learning as I explore ECMAScript 6 and what it means to the way that code is written today. In my search I found two great articles that I am pulling information from:
My value add is to provide context for the previous posts and show how your code in the future could look like to implement many of the same features. And this topic is fluid so again, “your mileage may vary”. My intent is to give you can idea of what is coming and how soon to help you decide how deeply you want to invest in the current technologies. That said, one of the goals in ECMAScript 6 is to not break anything you are doing now.
Big changes are coming to the .NET platform that affect your development wherever you use .NET. The direction helps you develop applications (Web, Azure, Phone, Desktop. Windows Store, Linux, MacOS, iOs and Android) easier. So if you are going horizontal and targeting more than one variation of Windows, then this is for you.
For developers and architects, it provides keys to a new way to looking at how your code should be written. The new .NET implements the kinds of features we face every day. And the solutions are evolving from vertical solutions where each problem was a subset of some other bigger problem. Rather it becomes a set of contracts, where dependencies are clearly defined, where the contract can be implemented in different ways to meet specific needs.
Migrating the .NET base is no small task. Yet, the Microsoft teams have taken on the challenge to make it easier to build applications across platforms — and not just Microsoft platforms.
The new direction includes:
- Merging APIs into contracts to allow the targeting of multiple verticals
- No longer have different versions of .NET Framework
- .NET Core is a modular development stack that is the foundation of all future .NET platforms
- Combine unified Base Class Library
- Open Sourcing more of .NET. You’ll get .NET via NuGet, with source on GitHub.
This post boils down what these changes mean to developers and architects. And what it means to your code today. I’ve selected key passages from Introducing .NET Core. But you will also want to dig more into the article and watch as features are rolled out.
In the font-size property, you’ll know that there are many different measurements to use when defining the size of the font.
- xx-small through xx-large – relative to the default browser font size
- percentages – relative to the surrounding text
- em and ex – relative to the parent element
- pixels – relative to the screen resolution
Web sites reflect the company’s professional image. If your site renders improperly or not at all, your company’s reputation can be tarnished. If your site has browser display problems, visitors and potential customers will leave your site and not look back.
In the post Using Modernizr, Polyfills, YepNope, you learned how you can support browsers that might not have the capabilities that you need. But at some point you may not be able to support really old browsers. At that point, you may just want to recommend the user update. Even for enterprise apps, you will want to remind users to use a current browser rather than have your app fail because your app is expecting something that does not exist.>p>You can use the following code to help your users get up to date browsers. Continue reading
When you are writing your single page application (SPA) may find that you need to check your connection. The idea is that you might have one set of logic for your connected app and another for when you are disconnected.
In previous posts, AppCache for Offline Apps and Loading, Caching LoDash or Underscore Templates Using RequireJS, AppCache, you learned that your Web app did not have to be online to be run. In fact, when building HTML apps for mobile devices, you are running without a connection.
So how do you check? How do you know when you can upload and download new information from the Web?
Many of the comments on StackOverflow have to do with the connection hanging. The following snippets help you work around the issue.
It works fine in Firefox 11 but not in IE and Chrome. By default, IIS6 does not serve .json (no wildcard
MIME type). So you will see a 404 not found thrown.
By default, IIS in Windows Server 2003 and beyond does not serve files that aren’t of a MIME type that it knows about (instead returning 404 errors).
So, to serve up JSON files you need to add a MIME type to IIS to allow it to serve that type of file. You can set it at the site level or at the server level.