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

Tag Archives: RESTful Web Services

How to test a REST api from command line with curl

software-development-2-logo

If you want to quickly test your REST api from the command line, you can use curl. In this post I will present how to execute GET, POST, PUT, HEAD, DELETE HTTP Requests against a REST API. For the purpose of this blog post I will be using the REST api developed in my post Tutorial – REST API design ...

Read More »

REST Messages And Data Transfer Objects

software-development-2-logo

In Patterns of Enterprise Application Architecture, Martin Fowler defines a Data Transfer Object (DTO) as: An object that carries data between processes in order to reduce the number of method calls. Note that a Data Transfer Object is not the same as a Data Access Object (DAO), although they have some similarities. A Data Access Object is used to hide ...

Read More »

REST Tooling

software-development-2-logo

In section 6.3 of Roy’s dissertation, he explains how REST applies to HTTP. But the implementing a RESTful approach requires painstaking assembly without REST tooling. Java JAX-RS and API Management infrastructure reduce the learning curve, increase API adoption and decrease development effort by simplifying API creation, publication, and consumption. The Java API for RESTful Web Services: JAX-RS JSR 311, JAX-RS, is ...

Read More »

Spring RestTemplate with a linked resource

spring-interview-questions-answers

Spring Data REST is an awesome project that provides mechanisms to expose the resources underlying a Spring Data based repository as REST resources. Exposing a service with a linked resource Consider two simple JPA based entities, Course and Teacher:           @Entity @Table(name = "teachers") public class Teacher { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private ...

Read More »

An introduction to REST

software-development-2-logo

REST, or Representational State Transfer is an architectural style, or more simply, a set of constraints. We will look at the constraints REST imposes for web apps, but some highlights are:               Uniform interfaces: all resources are identified by URIs (think: links) It relies on a stateless, client-server, cacheable communications protocol (think: HTTP). Interaction with resources is ...

Read More »

How to compress responses in Java REST API with GZip and Jersey

Jersey-logo

There may be cases when your REST api provides responses that are very long, and we all know how important transfer speed and bandwidth still are on mobile devices/networks. I think this is the first performance optimization point one needs to address, when developing REST apis that support mobile apps. Guess what? Because responses are text, we can compress them. And with ...

Read More »

First steps with REST, Spray and Scala

scala-logo

On this site you can already find a couple of articles on how to do REST with a multiple of different frameworks. You can find an old one on Play, some on Scalatra and I even started an (as of yet unfinished) series on Express. So instead of finishing the series on Express, I’m going to look at Spray in ...

Read More »

The State of REST

software-development-2-logo

The S in REST stands for State. Unfortunately, state is an overloaded word. In this post I’ll discuss the two different kinds of state that apply to REST APIs. Applications The first type of state is application state, as in Hypermedia As The Engine Of Application State (HATEOAS), the distinguishing feature of the REST architectural style. We must first understand ...

Read More »

Spring Rest API with Swagger – Exposing documentation

spring-interview-questions-answers

Once you create API documentation it is important to make it available to the stakeholders. In ideal case, this published documentation would be flexible enough to account for any last-minute changes and also be easy to distribute (in terms of costs as well as time needed to accomplish this). To make this possible we will make use of what was accomplished ...

Read More »

Java EE 7 / JAX-RS 2.0 – CORS on REST

java-interview-questions-answers

Java EE REST application usually works well out of the box on a development machine where all server side resources and client side UIs point to “localhost” or 127.0.0.1. But when it comes to cross domain deployment (when the REST client is no longer on the same domain as the server that host the REST APIs), some work-around is required. ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials