-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestRequests.PS1
33 lines (29 loc) · 935 Bytes
/
TestRequests.PS1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Requires Powershell 7
$url = 'https://ec.europa.eu/tools/eudamed/api/devices/udiDiData/c7418f9f-3f31-4329-b2c1-956377dbe23b?languageIso2Code=de'
"Los gehts mit $url"
$start = Get-Date
$r = Invoke-WebRequest -UseBasicParsing -Uri $Url -ErrorAction SilentlyContinue -SkipHttpErrorCheck -Verbose
$ende = Get-Date
"Dauer: $(($ende-$start).TotalSeconds)"
"Ergebnis: $($r.Status)"
If ($r.StatusCode -eq 200) {
"Ausgabe:"
$r.Content
}
If ($r.StatusCode -eq 500) {
"Request timed out"
}
$url = 'https://ec.europa.eu/tools/eudamed/api/devices/udiDiData?primaryDi=E4947660611'
"Los gehts mit $url"
$start = Get-Date
$r = Invoke-WebRequest -UseBasicParsing -Uri $Url -TimeoutSec 200 -ErrorAction SilentlyContinue -SkipHttpErrorCheck -Verbose
$ende = Get-Date
"Dauer: $(($ende-$start).TotalSeconds)"
"Ergebnis: $($r.Status)"
If ($r.StatusCode -eq 200) {
"Ausgabe:"
$r.Content
}
If ($r.StatusCode -eq 500) {
"Request timed out"
}