File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
example/lib/src/components Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,25 @@ class _NetworkContentState extends State<NetworkContent> {
24
24
text: 'Send Request To Url' ,
25
25
onPressed: () => _sendRequestToUrl (endpointUrlController.text),
26
26
),
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
+ ),
27
38
],
28
39
);
29
40
}
30
41
31
- void _sendRequestToUrl (String text) async {
42
+ void _sendRequestToUrl (String text,{ Map < String , String > ? headers} ) async {
32
43
try {
33
44
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 );
35
46
36
47
// Handle the response here
37
48
if (response.statusCode == 200 ) {
You can’t perform that action at this time.
0 commit comments