Development Frameworks & APIs
Web Frameworks
- Web frameworks simplify and accelerate the development of web apps.
- Provide reusable components like user registration, authentication, etc.
- Help link front end to back end functionality.
Popular Frameworks
| Framework | Language | Usage |
|---|---|---|
| Laravel | PHP | Startups & small businesses |
| Express | Node.js | Used by PayPal, Yahoo, Uber, IBM |
| Django | Python | Used by Google, YouTube, Instagram |
| Rails | Ruby | Used by GitHub, Hulu, Twitch, Airbnb |
Popular websites often use a mix of frameworks and web servers.
APIs (Application Programming Interfaces)
- APIs connect the front end and back end to exchange data and perform actions.
- Enable modular, scalable architecture.
- Use HTTP protocols for data transfer.
API Functionality
- Front end sends a request with specific input.
- Back end processes the request and returns a response.
- Front end renders the output.
Query Parameters
- Used in GET/POST requests to send arguments.
Examples
GET:
/search.php?item=apples
POST:
POST /search.php HTTP/1.1
...
item=apples
Web APIs
- Allow remote access to app functionality via HTTP.
- Example: Weather API to get current temperature by city.
API Standards
SOAP (Simple Object Access Protocol)
- Uses XML for both request and response.
- Ideal for:
- Structured & binary data
- Stateful data
- More complex and verbose.
SOAP Example
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.example.com/soap/soap/"
soap:encodingStyle="http://www.w3.org/soap/soap-encoding">
<soap:Header>
</soap:Header>
<soap:Body>
<soap:Fault>
</soap:Fault>
</soap:Body>
</soap:Envelope>
REST (Representational State Transfer)
- Uses URL paths to send data and JSON for responses.
- More lightweight than SOAP.
- Ideal for modular, scalable web apps.
REST API Example
GET /category/posts/
{
"100001": {
"date": "01-01-2021",
"content": "Welcome to this web application."
},
"100002": {
"date": "02-01-2021",
"content": "This is the first post on this web app."
},
"100003": {
"date": "02-01-2021",
"content": "Reminder: Tomorrow is the ..."
}
}
REST Methods
REST uses various HTTP methods to perform different actions on the web application:
| Method | Function |
|---|---|
| GET | Retrieve data |
| POST | Create data (non-idempotent) |
| PUT | Create/replace data (idempotent) |
| DELETE | Remove data |
Summary
- Web frameworks streamline development.
- APIs power the interaction between front end and back end.
- REST is more common and lightweight, while SOAP is better for complex structured data.
Exercise
Target: 94.237.122.123:35717
Use GET request '/index.php?id=0' to search for the name of the user with id number 1?
Open your browser and visit http://94.237.122.123:35717/index.php?id=1

flag: superadmin