Forum Discussion

5 Replies

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi LeonLiang ,

     

    If you want to make a POST request to a web service through Power Query, you have to add the relevant data in the “Content”-parameter of the query . Please refer to:

    web-services-and-post-requests-in-power-query 


    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • LeonLiang's avatar
      LeonLiang
      Frequent Visitor

      Hi Liang,

       

      I didn't vote this as a solution. How come it became a solution?

       

      I tried to format my request as following:


      let
          start_date = Number.From(Date.From("01-01-2021")),

          // or  start_date = "01-01-2021"

          // or start_date = "2021-01-01"
          PostContents = start_date,
          Source = Json.Document(Web.Contents("https://testurl.com/api/getOrderList"),         [Content=Text.ToBinary(PostContents)])
      in
          Source

       

       

      It tells me the following error

       

      Not sure how to solve this problem?

       

      Leon

       

      • V-lianl-msft's avatar
        V-lianl-msft
        Community Support

        Hi LeonLiang ,

         

        In your code,  start_date is a number. You need to convert it into text to see if it works

         

        Best Regards,
        Liang
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.