---
title: path
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurlcomponents/path
---

# path

The path URL component, or nil if not present.

## Declaration

```swift
var path: String? { get set }
```

## Discussion

Discussion For example, in the URL http://www.example.com/index.html, the path is /index.html.

## See Also

### Accessing components in native format

- [fragment](foundation/nsurlcomponents/fragment.md)
- [host](foundation/nsurlcomponents/host.md)
- [encodedHost](foundation/nsurlcomponents/encodedhost.md)
- [password](foundation/nsurlcomponents/password.md)
- [port](foundation/nsurlcomponents/port.md)
- [query](foundation/nsurlcomponents/query.md)
- [queryItems](foundation/nsurlcomponents/queryitems.md)
- [scheme](foundation/nsurlcomponents/scheme.md)
- [user](foundation/nsurlcomponents/user.md)
