> For the complete documentation index, see [llms.txt](https://ios-course.cornellappdev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ios-course.cornellappdev.com/resources/textbook/networking-ii/alamofire.md).

# 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 %}
