If the API is working, your should see a Response section appear at the bottom. You should see Status: 200 OK, a Headers: field, and a Data: field containing something like this:<html><body>Lead has been successfully added to HubSpot<br/>submissionGuid=4dd4e3b251914c92aeb737d815b307c2</body></html>
About HTTP and REST
HTTPThe protocol that allows for sendingdocs back and forth on the web.
1 Client-server ArchitectureA server component offering services, listens for requests uponthese services. A client component desires that a service beperformed, sends a request to the server via a connector. client servertriggering process reactionary process
initiates interaction by responds to the requestsending a request for a by either performing theservice to be performed service or rejecting it client role server roleThis separation allows for the two components toevolve independently, which increases scalability.
2 Stateless CommunicationEach request from the client must contain all necessaryinformation to understand the request.This constraint induces:• Visibility – need to look at only one request to get the full nature of the request• Reliability – eases the task of recovering from failures• Scalability – not having to store data between requests allows the server to free resources
3 CacheCache constraints require that the data within a responseto a request be labeled as cacheable or non-cacheable. Ifa response is cacheable, a client cache is given the right toreuse the response data for later, equivalent requests.Cache constraints eliminate some interactions and improveefficiency and scalability. Cache can decrease reliabilitybecause of stale data.
4 Uniform Interface1. Identification of resources A resource is any information that can be named. An example of a resource is the current weather in Austin, TX. Resource identification requires the same authority who maintains the reference to a resource to also be responsible for preserving meaning of that resource.2. Manipulation of resources through representations The resources must be manipulated via representations. A client has no access to a resource directly, it can only send and receive representations from the server. (An example of a representation is an html page with a PNG image of the current weather in Austin, TX.)
Data Element Modern Web Examplesresource the intended conceptual target of a hypertext referenceresource identifier URL, URNrepresentation HTML document, JPEG imagerepresentation metadata media type, last-modified timeresource metadata source link, alternates, varycontrol data if-modified-since, cache-control
Connector Modern Web Examplesclient libwww, libwww-perlserver libwww, Apache, API, NSAPIcache browser cache, Akamai cache networkresolver bind (DNS lookup library)tunnel SOCKS, SSL after HTTP CONNECT
3. Self-descriptive messages States that all messages must include metadata which describe the meaning of the message.4. Hypermedia as the engine of application state The steps in a REST architecture must be invoked through hypermedia. More specifically, in order for an application’s process to move a step, it must invoke that next step from a reference inside the current representation.
1 Render the data where it’s located and send a fixed-format image to the recipient3options for adistributedhypermedia 2 Encapsulate the data with a rendering engine and send both to the recipient 3architect Send the raw data to the recipient along with metadata that describes the data type so that the recipient can choose their own rendering engine
5 Layered SystemLayered system style allows an architecture to be composedof hierarchical layers by constraining component behavior soeach component cannot ‘see’ beyond the immediate layerwith which they are interacting.Layered system style helps reduce complexity and promoteindependence. Layers can be used to protect new servicesfrom legacy clients. They can also add overhead.
6 Code on DemandREST allows client functionality to be extended bydownloading and executing code in the form of scripts.