Invoke-RestMethod with public class

Welcome Forums General PowerShell Q&A Invoke-RestMethod with public class

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
5 months, 4 weeks ago.

  • Author
    Posts
  • #100726

    Participant
    Points: 1
    Rank: Member

    I need to check Rest Api .
    the basic is — Invoke-RestMethod -Uri 'http://localhost:94/PathA/file.ashx' —

    I need to add also

    public class CallbackData
    {
    public string CallBackType { get; set; }
    public string Reference { get; set; }
    public string FrontSide { get; set; }
    public VerificationData VerificationData { get; set; }
    }

    public class VerificationData
    {
    [XmlElement("VerificationStatus")]
    public string VerificationStatus { get; set; }

    How can I combine them ?

  • #100870

    Keymaster
    Points: 1,619
    Helping HandTeam Member
    Rank: Community Hero

    I'm sorry, I don't understand what you're trying to accomplish.

    Are you asking how to perform Invoke-WebRequest inside the class? You'd need to define a method or a constructor inside the class, which is where you'd put your code that you want to run.

The topic ‘Invoke-RestMethod with public class’ is closed to new replies.