---
title: WebResource
framework: webkit
role: symbol
role_heading: Class
path: webkit/webresource
---

# WebResource

A WebResource object represents a downloaded URL. It encapsulates the data of the download as well as other resource properties such as the URL, MIME type, and frame name.

## Declaration

```swift
class WebResource
```

## Overview

Overview Use the init(data:url:mimeType:textEncodingName:frameName:) method to initialize a newly created WebResource object. Use the other methods in this class to get the properties of a WebResource object.

## Topics

### Initializing

- [init(data:url:mimeType:textEncodingName:frameName:)](webkit/webresource/init(data:url:mimetype:textencodingname:framename:)-914h4.md)

### Getting attributes

- [data](webkit/webresource/data.md)
- [url](webkit/webresource/url.md)
- [mimeType](webkit/webresource/mimetype.md)
- [textEncodingName](webkit/webresource/textencodingname.md)
- [frameName](webkit/webresource/framename.md)

### Initializers

- [init(coder:)](webkit/webresource/init(coder:).md)
- [init(data:URL:MIMEType:textEncodingName:frameName:)](webkit/webresource/init(data:url:mimetype:textencodingname:framename:)-6mz1.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Related Documentation

- [WebKit Objective-C Programming Guide](apple-archive/documentation/Cocoa/Conceptual/DisplayWebContent.md)

### Loading Resources (Legacy)

- [WebResourceLoadDelegate](webkit/webresourceloaddelegate.md)
