<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: POST requests in M Language without any parameters in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/POST-requests-in-M-Language-without-any-parameters/m-p/2985827#M40442</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/490092"&gt;@artikrh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Are you trying to connect to one REST API? If yes, could you please provide the related REST API info? And the following is the thread which has the similar problem as yours, hope it can also help you solve the problem.&lt;/P&gt;
&lt;DIV class=""&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/DataFormat-Error-We-found-extra-characters-at-the-end-of-JSON/td-p/1449707" target="_self"&gt;DataFormat.Error: We found extra characters at the end of JSON input&lt;/A&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;It should be&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;#"Authorization"&amp;nbsp;in&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Headers&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;let
    Source = Json.Document(Web.Contents("xxx", 
    [
        RelativePath = "xxx",
        Content=Text.ToBinary(""),
        Headers=[#"Content-Type"="application/json", 
        #"Authorization"="Bearer xxx"
        ]  
    ]))
    
in
    Source&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2022 07:08:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-23T07:08:10Z</dc:date>
    <item>
      <title>POST requests in M Language without any parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/POST-requests-in-M-Language-without-any-parameters/m-p/2983459#M40427</link>
      <description>&lt;P&gt;Hi, I have this REST API endpoint which expect a HTTP POST request in order to download a CSV file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the issue with PBI here is that this POST request does not have/expect any parameter as input, and in order to denote a POST request in M language according to some previous threads, I have to specify&amp;nbsp;&lt;EM&gt;Content = Text.ToBinary("")&lt;/EM&gt; within &lt;EM&gt;Web.Contents&lt;/EM&gt; to let PBI know it's a POST and not GET.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this just triggers another error:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DataFormat.Error: We found extra characters at the end of JSON input.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Details:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Value=,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Position=8&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I remove this line (therefore script does a GET request), for some reasons I get an "Access to resource is forbidden" message (for this particular API call, for the ones with GET expected it works just fine).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I proceed further with this "extra character" error? Many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 06:03:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/POST-requests-in-M-Language-without-any-parameters/m-p/2983459#M40427</guid>
      <dc:creator>artikrh</dc:creator>
      <dc:date>2022-12-22T06:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: POST requests in M Language without any parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/POST-requests-in-M-Language-without-any-parameters/m-p/2985827#M40442</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/490092"&gt;@artikrh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Are you trying to connect to one REST API? If yes, could you please provide the related REST API info? And the following is the thread which has the similar problem as yours, hope it can also help you solve the problem.&lt;/P&gt;
&lt;DIV class=""&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/DataFormat-Error-We-found-extra-characters-at-the-end-of-JSON/td-p/1449707" target="_self"&gt;DataFormat.Error: We found extra characters at the end of JSON input&lt;/A&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;It should be&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;#"Authorization"&amp;nbsp;in&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;Headers&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;let
    Source = Json.Document(Web.Contents("xxx", 
    [
        RelativePath = "xxx",
        Content=Text.ToBinary(""),
        Headers=[#"Content-Type"="application/json", 
        #"Authorization"="Bearer xxx"
        ]  
    ]))
    
in
    Source&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 07:08:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/POST-requests-in-M-Language-without-any-parameters/m-p/2985827#M40442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-23T07:08:10Z</dc:date>
    </item>
  </channel>
</rss>

