# Alamofire

### What is Alamofire?

**Alamofire** is an HTTP(S) networking library written in Swift. It is built on top of **URLSession**, but is a lot simpler to use. Common use cases include:

* Fetching a JSON from an API
* Post some data to an endpoint
* Download an image from a URL
* Authentication with a REST API

### Installing Alamofire

A3 and A4 starter code should already contain Alamofire via Swift Package Manager. Alternatively, we can install Alamofire with CocoaPods:

Simply add the line `pod 'Alamofire'` to our `Podfile` like so:

```
# Uncomment the next line to define a global platform for our project
# platform :ios, '9.0'

target 'MyApp' do
  use_frameworks!

  # Pods for MyApp

  pod 'Alamofire'
end
```

{% hint style="danger" %}
**Note that your Podfile will look different depending on the name of your project. In this case, my project is called “MyApp”. Also, make sure to open the Xcode&#x20;*****workspace*****&#x20;and not the project.**
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ios-course.cornellappdev.com/resources/textbook/networking-ii/alamofire.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
