Skip to content

Commit 94a6e5b

Browse files
feat: add w3c header example buttons
1 parent e7ab9a4 commit 94a6e5b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

example/lib/src/components/network_content.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,25 @@ class _NetworkContentState extends State<NetworkContent> {
2424
text: 'Send Request To Url',
2525
onPressed: () => _sendRequestToUrl(endpointUrlController.text),
2626
),
27+
Text("W3C Header Section"),
28+
InstabugButton(
29+
text: 'Send Request With Custom traceparent header',
30+
onPressed: () => _sendRequestToUrl(endpointUrlController.text,headers: {
31+
"traceparent":"Custom traceparent header"
32+
}),
33+
),
34+
InstabugButton(
35+
text: 'Send Request Without Custom traceparent header',
36+
onPressed: () => _sendRequestToUrl(endpointUrlController.text),
37+
),
2738
],
2839
);
2940
}
3041

31-
void _sendRequestToUrl(String text) async {
42+
void _sendRequestToUrl(String text,{Map<String,String>? headers}) async {
3243
try {
3344
String url = text.trim().isEmpty ? widget.defaultRequestUrl : text;
34-
final response = await http.get(Uri.parse(url));
45+
final response = await http.get(Uri.parse(url),headers: headers);
3546

3647
// Handle the response here
3748
if (response.statusCode == 200) {

0 commit comments

Comments
 (0)