Week 4 Flashcards
Define HTML
- Hypertext Markup Language
- markup language for creating the STRUCTURE and CONTENT of web pages and applications (styling is CSS and JS)
Attributes used on tag and elements (7)
- action
- target
- name
- method
- value
- placeholder
- required
Explain Declaration
- introduced in HTML5
- used to inform the browser about the version of HTML used in the document
- instructs the browser about the document type
- Documentation Type Declaration (DTD)
Explain Character Encoding
- an approach of converting bytes into characters. For validating the HTML document, a program must choose a character encoding
- HTML5 uses UTF-8 as default character encoding, defined by “meta”
Syntax to start an HTML Document
- DOCTYPE declaration - tells browser the version of HTML being used (5)
- < html > - everything about webpage is nested within this tag
- < head > - all the metadata associated with webpage, including the title, character encoding, and references to external stylesheets
- < body > - contains the actual content of our page that will be rendered on the screen by the browser
How to make a hyperlink?
use < a > tag with link inside the brackets
Tags for creating tables
< tr > defines table row < th > defines table headers < td > defines table cell (data)
What are the 2 options for making lists?
< ol > ordered lists (1st, 2nd, 3rd)
< ul > unordered lists (bullet points)
< li > used to list items
Define elements
- provide the structure of the document
- defined within HTML files using tags < >…>
- may be nested within other elements
Define attributes
- these are key/value pairs that give metadata about the tag that are important for the browser to know.
- EX - needs a URL inside the tags
What are HTML Forms and why would we use them?
a section of a document that contains controls
used to collect some information/data from the user
some tags would be: < form > < input > < label > < textarea > < button > < select > < option >
Examples of HTML Forms (9)
- text fields - one-line input field to input a line of text. specify the type attribute value as “text”
- password fields - type of text field in which the text is masked using asterisk or dots. specify the type attribute value as “password”
- radio buttons - let the user select exactly one value from a list of predefined options. specify the type attribute value as “radio”
- checkboxes - let the user select one or more values from a pre-defined set of options. specify the type attribute value as “checkbox”
- file select boxes - to select a local file on their computer and send it as an attachment to the webserver. specify a type attribute value as “file”
- text area - multi-line text input control. created by using the “textarea” element. “rows” and “cols” dictate size of box
- select boxes (drop-downs) - select one or more options from a drop-down list using and
- reset buttons - reset the form data and will display any default values. specify the type attribute as “reset”
- submit buttons - send the form data to the web server. specify the type attribute as “submit”
What is a Web Service?
- a generic term for an interoperable machine-to-machine software function that is hosted from a network addressable location.
- interoperable - different languages, hardware, environments, able to operate together thanks to some clearly defined communication protocol
- network addressable - remote, available over a network
Advantages of Web Services (4)
- Expand functionality of the way we use the web
- Expose functionality for accessibility and reuse
- Standardization & interoperability
- Loose coupling (separate technologies to function on own or together)
What is REST (Representational State Transfer)?
- an architectural style for web services
1. Representational - resources (objects) are represented as JSON or XML for transfer.
2. State - referring to a resource as it exists in that moment, a resource representation.
3. Transfer - the resource representation is transmitted.
What is a resource in REST?
- unit of identifiable information
- an analog of an object in OOP
- as a resource changes over time it is not a new resource; the same resource is in a different state
- resources are identified by a URI (Universal Resource Identifier)
What are the 6 architectural constraints that need to be followed in order to be RESTful?
- uniform interface
- stateless
- cacheable
- client-server
- layered system
- code on demand (*optional)
What is HTTP?
- HyperText Transfer Protocol
- client-server protocol we use the browse the web; client initiates communication
- every communication is made up of client request and server response
- stateless
Each HTTP request is composed of.. (5)
- HTTP Verb - the HTTP method to execute
- URI - indicates the endpoint used to access the resource
- HTTP Version - in order to be certain of communication protocol
- Request Header - Metadata (info) about the request represented as key-value pairs
- Request Body - message content (resource representation in REST)
Each HTTP response is composed of.. (4)
- HTTP StatusCode - code indicating the status of the request
- HTTP Version - in order to be certain of communication protocol
- Response Header - Metadata (info) about the response represented as key-value pairs
- Response Body - message content (resource representation in REST)
HTTP Status Codes
100 - Informational
200 - Success
- 201 - created / 204 - no content
300 - Redirect
- 301 - moved permanently / 304 - not modified
400 - Client Error
- 403 - forbidden / 404 - not found / 405 - method not allowed / 415 - unsupported media type / 451 - unavailable for legal reasons
500 - Server Error
- 501 - not implemented / 502 - bad gateway / 503 - service unavailable
What is a server?
software designed to process requests and deliver responses to another computer over the internet (ex Tomcat)