<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "swift: -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKDirections/Request/init(contentsOfURL:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKDirectionsRequest(im)initWithContentsOfURL:::SYNTHESIZED::c:objc(cs)MKDirectionsRequest"
  },
  "title" : "init(contentsOfURL:)"
}
-->

# init(contentsOfURL:)

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

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

## Parameters

`url`

The URL provided to your app.

## Return Value

An initialized directions request object.

## Discussion

You should use the [`isDirectionsRequest(_:)`](/documentation/MapKit/MKDirections/Request/isDirectionsRequest(_:)) method to verify that the specified URL is of the correct format before calling this method to initialize the object.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)