Home Dashboard Directory Help
Search

Invoke-RestMethod does not handle http response code 204 correctly by Dirk-Jan Smits


Status: 

Active


6
0
Sign in
to vote
Type: Bug
ID: 785369
Opened: 4/23/2013 3:12:45 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

LS,

The Invoke-RestMethod keeps waiting for a body, even when the response code is 204 (No Content), after a while a timeout occurs and the statement returns this error:

Invoke-RestMethod : The operation has timed out
At line:83 char:15
Details
Sign in to post a comment.
Sign in to post a workaround.
Posted by dlrohm on 6/28/2013 at 8:24 PM
I had this issue when calling a REST method on an Artifactory server. Invoke-RestMethod chokes on 204 response and ends up timing out consistently. I changed this to Invoke-WebRequest and it works fine.