To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
The HTTP Handler Basics
Cancel

Build HTTP Services in DataFlex

Lesson 1 - The HTTP Protocol

What is HTTP? It was invented in 1989 and is an application layer protocol built on top of TCP IP. The client and server communicate in a request-and-response format.  HTTP is the basis for the web as it is known today. It is used to load web pages, the content inside the web pages, applications can use HTTP as well as web services such as SOAP. 

HTTP requests start with verb that indicates the operation of the client that is trying to perform on the server. For example, a “GET” request tries to pull a resource from the server. After the verb is the path that indicates where the resource is located. Then there is the protocol version that indicates which protocol version the client is using and supports. HTTP headers follow that display values for all sorts of things. They typically include the host, which is the domain name that is used for the ‘User-Agent’ string and various other settings. Some HTTP requests will also have a request body.

HTTP responses first include the protocol version, and then a status code. The status code indicates to the client if the handling of the request went well or if something is wrong. There is also a status message, which is a textual description of that status. A set of headers are also returned. The body follows the headers and can basically be anything. A commonly used header is the content-type header that usually indicates the type of content that is sent back. 

There are several types of request methods (verbs), but here are the most common…

  • GET: loads a resource from the server, but nothing is sent to the server
  • POST: the client posts data to the server that needs to be processed
    • The request has a body as well as a response

  • PUT: puts data on the server. 
    • The request has a body but the response usually does not
  • DELETE
  • PATCH 
  • OPTIONS

Response status codes have been standardized. Those in the 200 range indicate success. 201, for example, indicates hat something was successfully created, and 202 indicates something was accepted. Those in the 300 range indicates redirection or that something has moved on the server. 400 range codes are client errors; 400 is a bad request, 401 is unauthorized access, and 404 is path not found.  

500 range codes are server errors; 500 is an internal server error and 501 states that a function has not been implemented. 

Query string parameters are parts of the path that are sent to the server. They are name value peers that are appended to the path. These are also called GET parameters.  

This screen shot of Firefox’s developer tools shows the number of ASP requests done to load just www.Google.com

The usage HTTP is broad. It is used to show web pages where the responses contain HTML, CSS, JavaScript, Images, Videos, etc. Services will use XML and JSON.

HTTPS is secured HTTP over an SSL connection that can be configured at the IIS level. That is covered in another course, Secure Your Web Applications with HTTPS.