RUVIDEO
Поделитесь видео 🙏

API Implementation in Java | REST API | REST API Implementation Part 2

Code : https://github.com/akmalzz/DC_Assignments


REST - Representational State Transfer
What is REST?

REST is an architectural style which is based on web-standards and the HTTP protocol. This style was initially described by Roy Fielding in 2000. In a REST based architecture everything is a resource. A resource is accessed via a common interface based on the HTTP standard methods. In a REST based architecture you have a REST server which provides access to the resources. A REST client can access and modify the REST resources.

Every resource should support the HTTP common operations. Resources are identified by global IDs (which are typically URIs).

REST allows that resources have different representations, e.g., text, XML, JSON etc. The REST client can ask for a specific representation via the HTTP protocol (content negotiation).
HTTP methods

The PUT, GET, POST and DELETE methods are typical used in REST based architectures. The following table gives an explanation of these operations.

GET defines a reading access of the resource without side-effects. The resource is never changed via a GET request, e.g., the request has no side effects (idempotent).

PUT creates a new resource. It must also be idempotent.

DELETE removes the resources. The operations are idempotent. They can get repeated without leading to different results.

POST updates an existing resource or creates a new resource.

RESTFul web services

A RESTFul web services are based on HTTP methods and the concept of REST. A RESTFul web service defines the base URI for the services, the supported MIME-types (XML, text, JSON, user-defined, …). It also defines the set of operations (POST, GET, PUT, DELETE) which are supported.
Installation of Jersey
Use Gradle

compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.25.1'

Manual setup of Jersey libraries in an Eclipse project

Download the Jersey distribution as zip file from the Jersey download site.

The zip contains the Jersey implementation JAR and its core dependencies. It does not provide dependencies for third party JARs beyond those for JSON support and JavaDoc.

Copy all JARs from your Jersey download into the WEB-INF/lib folder.
jerseryfirst40
Web container

For this tutorial you can use any web container, for example Tomcat or the Google App Engine.

If you want to use Tomcat as servlet container please see Eclipse WTP and Apache Tomcat for instructions on how to install and use Eclipse WTP and Apache Tomcat.

The following description is based on a local Apache Tomcat installation.
Required setup for Gradle and Eclipse web projects

This section describes how to setup Eclipse WTP in a Gradle project. This is required for the following tutorials.
Prerequisites

Make sure that you followed the Eclipse WTP Tutorial to install Eclipse WTP.

Make also sure that you followed the Eclipse Buildship Tutorial to enable Gradle support for Eclipse.

If you have not yet created a Gradle project, you can follow the Buildship tutorial to create one.
Gradle setup

Open the build.gradle file and add the following two lines.

apply plugin: 'war'
apply plugin: 'eclipse-wtp'

Since we want to create a web application, we want a war file (and not a jar file which would be created by Gradle with the Java plugin). The eclipse-wtp plugin helps you to generate the Eclipse WTP project files.

Now, add a new folder with the name WebContent to your projects root. To do so, right click on the projects name New Folder. Add another folder with the name WEB-INF to your WebContent folder.

The next step is to add a xml file with the name web.xml to the created WEB-INF folder. To do so menu: right click on the created folder name[New Other…] and select XML file.

Your folder structure should now look something like this:
projectstructure

Now the newly created folders with the web.xml in it has to be added to the build.gradle file by adding the following line:

project.webAppDirName = 'WebContent'

Perform a right-click on the project and select Gradle Refresh Gradle Project…. This will add various new tasks to your Gradle Tasks view.
taskview

Run the eclipseWTP task to generate the Eclipse WTP project files and finish the project setup. == Prerequisites

The following description assumes that you are familiar with creating web applications in Eclipse. See Eclipse WTP development for an introduction into creating web applications with Eclipse.

Content : https://www.vogella.com/tutorials/REST/article.html

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «API Implementation in Java | REST API | REST API Implementation Part 2», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.