Skip to main content

API's

 

API's

Types of API's

REST API - Representational State Transfer is a commonly used API category that isn’t dependent on a specific protocol. It’s considered a relatively user-friendly API to work with and many developers are experienced in this technology. It’s an architecture style of communicating interfaces.

SOAP API - Simple Object Access Protocol is an API that connects different platforms together through HTTP and XML. Its relatively older than other API implementations, but it provides more security as it follows strict protocols. It’s a protocol for communication between applications.

ASP.NET API - Specific form of REST API developed around .NET technology.


REST vs SOAP

Both have some similarities for instance they both support SSL/TLS for secure and encrypted communications, also they both use HTTP to exchange information. When deciding which API to use you must take in many factors into consideration like, security, ACID compliance, and overall application design. For instance, REST is a better choice if you’re trying to build a public API as they have lower security requirements and are much more flexible.

 

SOAP

REST

Design

Exposes the operation

Exposes the data

Transport protocol

Independent and can work with any transport protocol

Only works with HTTPS

Data format

Only supports XML data exchange

Supports XML, JSON, HTML, and plain text

Performance

Larger messages, which makes communications slower

Has a faster performance due to smaller messages and catching support

Scalability

Difficult to scale as the server maintains state by storing all previous messages exchanged with a client

Easy to scale due to it being stateless so every message is processes independently of previous messages

Security

Supports encryption with additional overheads

Supports encryption without effecting the overall performance

Use case

Useful in legacy applications and private API’s

Useful in modern applications and public API’s

 

LHTTP request methods

An average rest-based architecture uses mainly 4 HTTP methods.

HTTP method

CRUD method

Description

POST

CREATE/INSERT

Adds a new resource

GET

READ/SELECT

Reads the resource

PUT

UPDATE

Edits an existing resource

DELETE

DELETE

Deletes a resource

 

HTTP status codes

  • 1XX - informational
  • 2XX - success
  • 3XX - redirection
  • 4XX - client error
  • 5XX - server error

The most common HTTP status codes are:

·         200 – ok

·         301 – moved permanently

·         303 – see other

·         400 – bad request

·         403 – forbidden

·         404 – not found

·         500 – internal server error

Comments

Popular posts from this blog

Types of network adapters in virtual box

  Types of network adapters in VirtualBox In VirtualBox there’s multiple types of network adapters that can be used to configure virtual machines for different networking needs. Down below will give you a brief overview of each type. NAT (network address translation) The VM is placed behind a VirtualBox-managed router. This allows the VM to access the external network via the networks host’s IP, but the VM itself remains invisible to the outside. Its most suitable for simple internet access with minimal configuration NAT network This is like NAT, but it allows multiple VM’s to communicate with each other in the same NAT network all while sharing the host’s internet connection. Its commonly used when you want to simulate a small, isolated network of VM’s that can also access the internet. Bridged adapter This VM is connected directly to the physical network as if it is a separate device, it also receives its own IP address from the same network as the host. This is ide...
  Designing a SOHO network with DHCP Network requirements for the office Sales department – 4 computers Finance department – 3 computers Networking devices requirement: ·          1 router ·          2 switches (one for each department) ·          1 DHCP server Documentation I started by setting up the network topology and used the automatic connecting cable to connect all the devices together. Then I configured the server with IPv4 address and a subnet mask. to do this you have to press on the server and then go to desktop. Then I filled in all the parameters as seen below. Then I had to configure the DHCP server. To do this I clicked on the server > services > DHCP. Then I turned on the serves and configured the server as seen in this screenshot. For the next step I configured the router with the IPv4 address and subnet mask. To a...