Just in case anyone else runs into this issue, Invoke-Request only returns the response body of a request. If you want the entire response, you'll have to use Invoke-WebRequest instead. Then you can check the response code to see if your request was successful or not. You'll see 200 if there were no issues.
Thank you very much ! I am getting ConvertFrom-Json : Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.Could you help me out to solve this? Example $data '{"status":true,"status_code":200,"message":"messages.succes","data":[ {"orderdate":"2019-11-15 09:49:02","sales":50,"revenue":6700,"":0} $TestObject = ConvertFrom-Json -InputObject $data ]}' I know I can replace "" but this is a part of a big json file which is downloaded from a site Can i maybe assign headers ?
No it only works on a few of their endpoints. they have a proper API to connect and consume their data that you can find here www.reddit.com/dev/api/ but it's a bit more complicated so I chose to use the .json method for the video since it's very easy to see and show
Website: mrpowerscripts.com
Discord: discord.gg/uEBWZKq
Patreon: patreon.com/mrpowerscripts
SIGN UP: mrpowerscripts.com/mailing-list
Just in case anyone else runs into this issue, Invoke-Request only returns the response body of a request.
If you want the entire response, you'll have to use Invoke-WebRequest instead. Then you can check the response code to see if your request was successful or not. You'll see 200 if there were no issues.
Thank you very much ! I am getting ConvertFrom-Json : Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.Could you help me out to solve this? Example $data '{"status":true,"status_code":200,"message":"messages.succes","data":[
{"orderdate":"2019-11-15 09:49:02","sales":50,"revenue":6700,"":0}
$TestObject = ConvertFrom-Json -InputObject $data
]}'
I know I can replace "" but this is a part of a big json file which is downloaded from a site
Can i maybe assign headers ?
This video made my day... Thanks
Does every URL supposed to have a /.json to get their API info?
No it only works on a few of their endpoints. they have a proper API to connect and consume their data that you can find here www.reddit.com/dev/api/ but it's a bit more complicated so I chose to use the .json method for the video since it's very easy to see and show
6:04 title lool
¯\_(ツ)_/¯
Dude, great tutorial - I chuckled when I saw the ohhhhhhhhh snap! comment!
Thanks dude. Glad you found it helpful.
This is so freaking cool!!!!
Your face is so freaking cool
Great subject. Looking forward for more :)
+Portentous Lad Thanks bro. Post requests up next. Way more fun.
Will do. :)
have no experience with anything json related so this is already highly appreciated.
MrPowerScripts has
Thanks you, i was stuck
Most useful info about powershell or how to use a rest API for that matter, I’ve ever watched. Thank you
RIP Reddit API
very cool.