---
title: "init(contentsOfURL:)"
framework: mapkit
role: symbol
role_heading: Initializer
path: "mapkit/mkdirections/request/init(contentsofurl:)"
---

# init(contentsOfURL:)

Creates and returns a directions request object using the specified URL.

## Declaration

```swift
init(contentsOfURL url: URL)
```

## Parameters

- `url`: The URL provided to your app.

## Return Value

Return Value An initialized directions request object.

## Discussion

Discussion You should use the isDirectionsRequest(_:) method to verify that the specified URL is of the correct format before calling this method to initialize the object.

## See Also

### Creating a directions request object

- [isDirectionsRequest(_:)](mapkit/mkdirections/request/isdirectionsrequest(_:).md)
