Skip to content

Commit

Permalink
Expanded the examples and added another descriptive sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruin-NR committed Nov 10, 2023
1 parent 3e0ac70 commit 23b3db1
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NewRelic.addHTTPHeadersTrackingFor(List<String> headers)

## Description [#description]

This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events.
This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events. After header fields have been added using this function, if the headers are in a network call they will be included in networking events in NR1.

Check warning on line 37 in src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'been added' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'been added' looks like passive voice.", "location": {"path": "src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx", "range": {"start": {"line": 37, "column": 153}}}, "severity": "INFO"}

Check warning on line 37 in src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'be included' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'be included' looks like passive voice.", "location": {"path": "src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx", "range": {"start": {"line": 37, "column": 232}}}, "severity": "INFO"}
The Android agent currently automatically captures the following header fields: X-APOLLO-OPERATION-NAME, X-APOLLO-OPERATION-TYPE, and X-APOLLO-OPERATION-ID.

## Parameters [#parameters]
Expand Down Expand Up @@ -119,7 +119,7 @@ func addHTTPHeaderTracking(for: [String])

## Description [#description]

This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events.
This API allows you to add any header field strings to a list that gets recorded as attributes with networking request events. After header fields have been added using this function, if the headers are in a network call they will be included in networking events in NR1.

Check warning on line 122 in src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'been added' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'been added' looks like passive voice.", "location": {"path": "src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx", "range": {"start": {"line": 122, "column": 153}}}, "severity": "INFO"}

Check warning on line 122 in src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'be included' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'be included' looks like passive voice.", "location": {"path": "src/content/docs/mobile-monitoring/new-relic-mobile/mobile-sdk/add-tracked-headers.mdx", "range": {"start": {"line": 122, "column": 232}}}, "severity": "INFO"}
The iOS agent currently automatically captures the following header fields: X-APOLLO-OPERATION-NAME, X-APOLLO-OPERATION-TYPE, and X-APOLLO-OPERATION-ID.

## Parameters [#parameters]
Expand Down Expand Up @@ -165,10 +165,22 @@ Here's an example of adding some HTTP header fields:
```objectivec
[NewRelic addHTTPHeadersTrackingFor:@[@"Example", @"Example2"]];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.newrelic.com"]];
NSMutableURLRequest *mutableRequest = [request mutableCopy];
[mutableRequest addValue:@"Test" forHTTPHeaderField:@"Example"];
[mutableRequest addValue:@"Test2" forHTTPHeaderField:@"Example2"];
request = [mutableRequest copy];
[[NSURLSession sharedSession] dataTaskWithRequest:request];
```
```swift
NewRelic.addHTTPHeadersTracking(for:["Example", "Example2"])
var request = URLRequest(url: URL(string:"https://www.newrelic.com")!)
request.addValue("Test", forHTTPHeaderField: "Example")
request.addValue("Test2", forHTTPHeaderField: "Example2")
URLSession.shared.dataTask(with: request)
```
</TabsPageItem>
Expand Down

0 comments on commit 23b3db1

Please sign in to comment.