Title: Invoke-RestMethod doesn't return useful info when no data is returned. · Issue #5320 · PowerShell/PowerShell · GitHub
Open Graph Title: Invoke-RestMethod doesn't return useful info when no data is returned. · Issue #5320 · PowerShell/PowerShell
X Title: Invoke-RestMethod doesn't return useful info when no data is returned. · Issue #5320 · PowerShell/PowerShell
Description: Steps to reproduce You will need to generate an API token and grant the notifications privilege. PS /Users/greg> $apitoken = "yourapitoken" PS /Users/greg> $headers = @{ Authorization = "token $apitoken" } PS /Users/greg> $resp = Invoke-...
Open Graph Description: Steps to reproduce You will need to generate an API token and grant the notifications privilege. PS /Users/greg> $apitoken = "yourapitoken" PS /Users/greg> $headers = @{ Authorization = "token $api...
X Description: Steps to reproduce You will need to generate an API token and grant the notifications privilege. PS /Users/greg> $apitoken = "yourapitoken" PS /Users/greg> $headers = @{ Authorizati...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5320
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-RestMethod doesn't return useful info when no data is returned.","articleBody":"Steps to reproduce\r\n------------------\r\nYou will need to [generate](https://github.com/settings/tokens) an API token and grant the notifications privilege.\r\n\r\n```powershell\r\nPS /Users/greg> $apitoken = \"yourapitoken\"\r\nPS /Users/greg> $headers = @{ Authorization = \"token $apitoken\" }\r\nPS /Users/greg> $resp = Invoke-RestMethod -Uri https://api.github.com/notifications -Headers $headers\r\nPS /Users/greg> $resp -eq $null \r\nPS /Users/greg>\r\n```\r\n\r\nWhat is returned is an `Object`.\r\n```powershell\r\nPS /Users/greg> $resp -is [System.Object] \r\nTrue\r\nPS /Users/greg> \r\n```\r\n\r\nShould be no different than this.\r\n\r\n```powershell\r\nPS /Users/greg> $obj = New-Object System.Object \r\nPS /Users/greg> $obj -eq $null \r\nFalse\r\nPS /Users/greg> \r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n```powershell\r\nPS /Users/greg> $resp -eq $null\r\nTrue\r\nPS /Users/greg>\r\n```\r\n\r\nActual behavior\r\n---------------\r\n```powershell\r\nPS /Users/greg> $resp -eq $null\r\nPS /Users/greg>\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n```powershell\r\nName Value \r\n---- ----- \r\nPSVersion 6.0.0-beta.9 \r\nPSEdition Core \r\nGitCommitId v6.0.0-beta.9 \r\nOS Darwin 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/R...\r\nPlatform Unix \r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} \r\nPSRemotingProtocolVersion 2.3 \r\nSerializationVersion 1.1.0.1 \r\nWSManStackVersion 3.0\r\n```\r\n\r\nThis occurs for Windows PowerShell versions too.","author":{"url":"https://github.com/thezim","@type":"Person","name":"thezim"},"datePublished":"2017-11-03T02:32:03Z","url":"https://github.com/PowerShell/PowerShell/issues/5320"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ff7bddd7-0439-818a-cc82-ad032df1fc57 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BAC:11259D:1D6FA9:28D228:6AFD809A |
| html-safe-nonce | 59c85c046f30186e998d24dcdbf5061f9158f1ceeff0818ca9bae45936b7fe68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkFDOjExMjU5RDoxRDZGQTk6MjhEMjI4OjZBRkQ4MDlBIiwidmlzaXRvcl9pZCI6IjI1MDE5NDE3NjAyMjYwNjY1ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a1b47458e85bdc7eb6824f5c76002d16d4eb59a04a4f5b5f6705ddc2aceae4a4 |
| hovercard-subject-tag | issue:270863800 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/5320/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c5ced4c1c8f37f4f3f95f9405f91a04136cbfe6da948093bde427e97173ce05a/PowerShell/PowerShell/issues/5320 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c5ced4c1c8f37f4f3f95f9405f91a04136cbfe6da948093bde427e97173ce05a/PowerShell/PowerShell/issues/5320 |
| og:image:alt | Steps to reproduce You will need to generate an API token and grant the notifications privilege. PS /Users/greg> $apitoken = "yourapitoken" PS /Users/greg> $headers = @{ Authorization = "token $api... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thezim |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42d4967e3c8afca51ccac31f419a705af777226a95f025ea73387d87a306b326 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2329ceed0bc2c7b7c3b9f5f2db6abfc7b6fc3a50 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width