Examples

Add Item to Cart

A POST request to /member/109087/cart will create a cart resource for the member (if one did not exist) and add the inventory item to the cart. The
Location header links to the cart resource that was created or updated. It is optional to add the JSON-HAL representation of that resource as the
POST response, but not required.

Calculate Payment

A GET request to /payment will calculate the total amount owed by the member based on the contents in the members cart. The calculation results,
along with any discounts (coupons, giftcards, etc) are sent back for the member to review. The relation to http://example.com/payment/coupon allows
the member to add and remove any coupons from the calculation.

This comment has been minimized.

This is one of the better examples I've seen for leveraging a hypermedia representation, kudos.

A couple things I'd like to ask about it if you don't mind 10 months later. I'd like to better understand how you are using the link relations in the position of object property name.

Are use assuming any sort of URL pattern, i.e. "http://example.com/rels/{type}" and thus are extracting "{type}" from the URLs, or did you just use that pattern for your own convenience?

If for your own convenience, how does your client code process those? Does it hardcode the string "http://example.com/rels/billing" into its logic to mean "this is where the member's billing address is located?" Or does the URL http://example.com/rels/billing provide meta data processing rules that allow you to somehow grok this?

This is one of the better examples I've seen for leveraging a hypermedia representation, kudos.

A couple things I'd like to ask about it if you don't mind 10 months later. I'd like to better understand how you are using the link relations in the position of object property name.

Are use assuming any sort of URL pattern, i.e. "http://example.com/rels/{type}" and thus are extracting "{type}" from the URLs, or did you just use that pattern for your own convenience?

If for your own convenience, how does your client code process those? Does it hardcode the string "http://example.com/rels/billing" into its logic to mean "this is where the member's billing address is located?" Or does the URL http://example.com/rels/billing provide meta data processing rules that allow you to somehow grok this?

This comment has been minimized.

REST API can be deployed for functions like browsing through the app, adding to cart, chat, login etc while SOAP can be used for those which involve top-of-the-line security like payment transactions (payment gateway) etc.

Major sites uses:
Content management systems like Joomla, WordPress, social media like Twitter, LinkedIn make use of REST while cloud-based CRM like Salesforce and payment gateways like PayPal are built using SOAP.

REST uses a single line of code.
The module (phonebook), action (User Detail) and ID (12345) are directly called locally whereas the same process is split into multiple client server interactions in case of SOAP

Edited 1 time

Oct 20, 2016

Intro : [https://gist.github.com/deepak-rajpal/66e9f1abec8be2857074]

REST API can be deployed for functions like browsing through the app, adding to cart, chat, login etc while SOAP can be used for those which involve top-of-the-line security like payment transactions (payment gateway) etc.

Major sites uses:
Content management systems like Joomla, WordPress, social media like Twitter, LinkedIn make use of REST while cloud-based CRM like Salesforce and payment gateways like PayPal are built using SOAP.

REST uses a single line of code.
The module (phonebook), action (User Detail) and ID (12345) are directly called locally whereas the same process is split into multiple client server interactions in case of SOAP