Skip to main content
Question

Call rest service from C#

  • April 8, 2015
  • 1 reply
  • 1 view

Forum|alt.badge.img+1

Hi
I am working with an asp.net application and want to call som rest services in JAMF. So far I have tested with ...JSSResource/computers just to try to get a list of computers.

However, I am not sure about how to configure the url, I have tried a couple of alternatives. But the url:s that leads to a successful logon do not return any data, just som html-code for the api documentation page.

I am using a System.Net.WebRequest and call GetResponse to get a System.Net.WebResponse back.
It is when I write out the reult with a streamreader that I only get the html-code, no data.

I hope somone can give some useful information.
Regards
P-E

1 reply

Forum|alt.badge.img+10
  • Employee
  • April 10, 2015

Are you including basic HTTP authentication with the request? The SO post seems to outline a method do send that along.

Other than that you should be able to just send a normal GET request to myjss.com/JSSResource/computers to get a list of computers.