Home » Tag Archives: RESTful Web Services (page 5)

Tag Archives: RESTful Web Services

Chained Access Delegation Pattern

software-development-2-logo

Suppose a medium-scale enterprise that sells bottled water has a RESTful API (Water API) that can be used to update the amount of water consumed by a registered user. Any registered user can access the API via any client application. It could be an Android app, an iOS app, or even a web application. The company only provides the API—anyone ...

Read More »

Embedded Jetty and Apache CXF: secure REST services with Spring Security

spring-interview-questions-answers

Recently I run into very interesting problem which I thought would take me just a couple of minutes to solve: protecting Apache CXF (current release 3.0.1)/ JAX-RS REST services with Spring Security (current stable version 3.2.5) in the application running inside embedded Jetty container (current release 9.2). At the end, it turns out to be very easy, once you understand ...

Read More »

RESTful API and a Web Site in the Same URL

software-development-2-logo

Look at Github RESTful API, for example. To get information about a repository you should make a GET request to api.github.com/repos/yegor256/rultor. In response, you will get a JSON document with all the details of the yegor256/rultor repository. Try it, the URL doesn’t require any authentication. To open the same repository in a nice HTML+CSS page, you should use a different ...

Read More »

REST API with JSON

json-logo

What is REST API? REST stands for Representational State Transfer. It relies on a stateless, client-server, cacheable communications. In most cases it is used with the HTTP protocol. RESTful applications use HTTP requests to POST (create), PUT (create and/or update), GET (e.g., make queries), and DELETE data. REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations.       What ...

Read More »

Behavior-Driven RESTful APIs

software-development-2-logo

In the RESTBucks example, the authors present a useful state diagram that describes the actions a client can perform against the service. Where does such an application state diagram come from? Well, it’s derived from the requirements, of course. Since I like to specify requirements using examples, let’s see how we can derive an application state diagram from BDD-style requirements. ...

Read More »

RESTBucks Evolved

software-development-2-logo

The book REST in Practice: Hypermedia and Systems Architecture uses an imaginary StarBucks-like company as its running example. I think this is a great example, since most people are familiar with the domain. The design is also simple enough to follow, yet complex enough to be interesting.   Problem Domain RESTbucks is about ordering and paying for coffee (or tea) ...

Read More »

Building a simple RESTful API with Spark

java-interview-questions-answers

Disclaimer: This post is about the Java micro web framework named Spark and not about the data processing engine Apache Spark. In this blog post we will see how Spark can be used to build a simple web service. As mentioned in the disclaimer, Spark is a micro web framework for Java inspired by the Ruby framework Sinatra. Spark aims ...

Read More »

REST Maturity

software-development-2-logo

In 2008, Leonard Richardson published his Maturity Heuristic that classified web services into three levels based on their use of URI, HTTP, and hypermedia. Back then, most web services were stuck at either level 1 or 2. Unfortunately, not a whole lot has improved since then in that respect: so-called pragmatic REST is still the norm.   BTW, I really ...

Read More »

Spring Rest Controller with angularjs resource

spring-interview-questions-answers

Angularjs ngResource is an angularjs module for interacting with REST based services. I used it recently for a small project with Spring MVC and wanted to document a configuration that worked well for me. The controller is run of the mill, it supports CRUD operations on a Hotel entity and supports the following methods:           POST ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.