This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

What is the difference between HTTP API and REST API (while creating AWS Lambda)?

 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While creating AWS lambda, on selecting API Gateway trigger, it gives the option of choosing REST API or HTTP API.  Both look like REST API to me. How is HTTP API different from REST API? Thanks.
 
Ishan Shah
Ranch Hand
Posts: 82
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
REST API:-
It has no official standard since it is primarily an architectural style.
Can use several standards like HTTP, URL, JSON, and XML
It takes less bandwidth and resources since it deploys multiple standards.
It utilizes URL exposure such as @path to expose business logic
It uses services interfaces such as to expose business logic
Convenient with JavaScript and allows easy implementation.
Utilizes Web Application Description Language.
WEB-API or SOAP-API:-

Based largely on HTTP and XML.
It only features SSL.
It uses service interfaces such as to expose business logic.
Based largely on HTTP and XML.
It is an official standard because it is a protocol.
Also convenient with JavaScript but is not supportive for greater implementation.
Uses Web Services Description language.


API is basically like a command for software, a command which one can execute by some defined protocols. HTTP is one such protocol.

Usually, APIs are created in applications and such applications are hosted on some server. Now to call those APIs one needs to use HTTP protocol over the network.


I hope this will help you
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Earlier there were SOAP based APIs which used WSDL. Then came the simpler REST APIs. Now what are HTTP APIs?
 
Tim Holloway
Saloon Keeper
Posts: 24339
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica Shiralkar wrote:Earlier there were SOAP based APIs which used WSDL. Then came the simpler REST APIs. Now what are HTTP APIs?



Good question. The best I could come up with was web API's that don't conform to ReST requirements, since ReST runs on HTTP.

SOAP is certainly a non-ReST API. It carries heavy payloads in both directions and generally assumes that you are only talking to one unique server, whereas in proper ReST, you can target a pool of servers rather than be bound to one specific one. WSDL, incidentally, I don't think was required to use SOAP, but it was definitely to be recommended, since it described and documented the SOAP protocols for the target site and could be used to generate a remote API interface. I'm unaware of any similar concept in ReST, though.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks

Tim Holloway wrote:

Good question. The best I could come up with was web API's that don't conform to ReST requirements, since ReST runs on HTTP.



I was knowing the Web services in Java can be either SOAP or REST. Does that mean we can have web service which is neither SOAP nor REST or does it instead mean that Web API is not a web service ?

ReST, you can target a pool of servers rather than be bound to one specific one.



Although this is not directly related to my original question, what does this mean?
 
Tim Holloway
Saloon Keeper
Posts: 24339
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the biggest reasons for developing ReST was to facilitate scalability. ReST is a sessionless protocol. Session-based protocols require maintaining state on the server and if you want to load-balance a popular website/app, then you could have problems if too many servers had active sessions while other servers were more or less idle.

At moderate scale, you can make state carry over from server to server in a server cluster - that's why HttpSession objects must be serializable, in fact (one reason why, anyway). But bouncing sessions between servers carries considerable overhead.

Since ReST doesn't use HttpSessions, you can have as many identical clones of the server as you wish, front-end them with a load-balancing dispatcher and get maximal use out of all server instances without the overhead of transferring sessions back and forth.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Is Http API a web service which is neither REST nor SOAP, or Http API is not a webservice at all?
 
Tim Moores
Saloon Keeper
Posts: 7111
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"HTTP API" is probably meant to be synonymous with "web service". As such, it may use neither SOAP nor be RESTful.
 
Tim Holloway
Saloon Keeper
Posts: 24339
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:"HTTP API" is probably meant to be synonymous with "web service". As such, it may use neither SOAP nor be RESTful.



Or, to flip it around, I'd classify both SOAP and ReST as one of many possible carrier mechanisms for HTTP APIs. Because underneath, they're all using HTTP.
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:"HTTP API" is probably meant to be synonymous with "web service". As such, it may use neither SOAP nor be RESTful.



Thanks. I knew SOAP web service and REST web service but  never knew this third category of web services names "Http Api".
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all.
Until I get familiar with Http API, in lambda functions better to choose REST APIs only as API gateway trigger.
 
Tim Moores
Saloon Keeper
Posts: 7111
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica Shiralkar wrote:I knew SOAP web service and REST web service but  never knew this third category of web services names "Http Api".


I wouldn't call it a third category - SOAP and REST use HTTP, after all. It's more correct to say that there are HTTP APIs that don't use SOAP and are not RESTful.
 
Paul Clapham
Sheriff
Posts: 26798
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that "HTTP API" is a technical term used by Amazon, besides being a generic term used by everybody else. See for example here: Choosing between HTTP APIs and REST APIs.

Since I don't work with those things I have no idea what Amazon means by "HTTP API".
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:I believe that "HTTP API" is a technical term used by Amazon, besides being a generic term used by everybody else. See for example here: Choosing between HTTP APIs and REST APIs.  




Thanks. Based on the link, it shows some difference between features provided by REST API and HttpAPI.  It shows a cross for  OAuth in case of REST API. However,  other links on internet say that REST APIs also have OAuth.

 
Ron McLeod
Marshal
Posts: 3658
516
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you ask about HTTP API vs. REST API, are you specifically asking in the context of AWS (or maybe even more specifically the AWS Lambda service)?
 
Monica Shiralkar
Ranch Hand
Posts: 2513
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding was that these are is universal. But now I am thinking that may be it is only for AWS context.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic