Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between HTTP Client and REST Client

Tags:

rest

http

client

I am a bit confused, whether there is any difference between the terms "HTTP client" and "REST Client"?

For example, I have found some libraries for Android that look like they were designed for consuming REST services, yet they call themselves an "HTTP client" (Retrofit) or "HTTP library" (Volley).

There is also for example a library that call itself "HTTP/REST client library" (jus for Android).

  • So, is "HTTP client" and "REST Client" the same thing?

  • Or is "REST Client" is an HTTP client with some additional functionalities?

  • What about JSON/XML parser? Are they considered a part of REST clients but not HTTP client?

I will really appreciate if someone could clarify this matter.

like image 989
displayname Avatar asked Apr 20 '18 23:04

displayname


2 Answers

enter image description here

To answer my own question:

  • HTTP client is a client that is able to send a request to and get a response from the server in HTTP format

  • REST client is a client that is designed to use a service from a server and this service is RESTful.

  • in most cases that I saw on the web, what is called REST client is actually a HTTP client, since it uses HTTP only and can communicate with a HTTP server which provides services that are not RESTful

like image 153
displayname Avatar answered Oct 17 '22 09:10

displayname


I think your second bullet point is true, beside it is not about functionalities, but about semantics. So REST describes how HTTP should be used, expressed by the data transferred (Links). Both (HTTP and REST) are not bound to a specific format like XML or JSON. Albeit JSON is polular, you could still transfer plain old HTML.

Have a look at What is the difference between HTTP and REST?

like image 21
sschrass Avatar answered Oct 17 '22 08:10

sschrass