New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use -ContentType parameter in Invoke-WebRequest #19
Conversation
The Invoke-WebRequest command offers a contenttype parameter. Setting the content type using the normal headers does not work for me
Hi Lukas, Thanks for your pull request. Could you provide some more information about what's going on? In every example I know of, the JIRA API that PSJira works with expects the body of a Web request to be in JSON format, and the -Headers parameter has been working as expected so far. I'd like to understand why it's not working correctly before making the change. Specifically, here are a few things that will help get started:
Thanks, |
Hi,
E.g. if a run New-JiraSession without any parameters, after entering the credentials I get the error. The unmodified New-JiraSession script does not show the error message itself, because $webResponse is null
I could not find another command that is affected by this issue, so maybe the changes in Invoke-JiraMethod are not necessary at all. However, I think that may still be a good idea, to be on the safe side. I have no explanation at the moment, why setting the contenttype there directly using the headers argument does work, but raises the error in new-jirasession |
Hey, I apologize for the delay in getting back to you here. Are you still running into this issue? If so, I'll update the test suite and have you double-check one more time that your commit is working correctly. |
Hi, no worries regarding the delay |
Hah, I think I may have goofed up my GitHub. I'm still getting used to working with PR's on this site. It looks like the changes I made aren't showing here in this pull request, but they appear in a new branch on the main page, pr/19. Could you download that branch (latest commit at the moment is 510cce6) and make sure that's working correctly for you? If so, I can merge the changes. |
Yep, it works for me now! Thanks |
The Invoke-WebRequest command offers a contenttype parameter. Setting
the content type using the normal headers does not work for me