Empty body content when doing a PUT request to Wiki pagesIs an entity body allowed for an HTTP DELETE request?HTTP GET with request bodyHow do you set the Content-Type header for an HttpClient request?I am trying to execute REST API within powershell using invoke-restmethod/invoke-webrequest but failed when I pass Json inputsInvoke-Webrequest incorect Json format “Cannot bind parameter 'Headers' ”VSTS create service connection via APIAzure DevOps git policy configurations api broken?Source Providers - List Branches - What is the providerName?is there any way to automate policykeys creation in identityexperienceframework under azure Ad B2C tenant?Update wiki page of tfs by calling rest-api

How to belay quickly ascending top-rope climbers?

How to get a type of "screech" on guitar

How do you send money when you're not sure it's not a scam?

Company looks for long-term employees, but I know I won't be interested in staying long

Why is Google approaching my VPS machine?

What is a Romeo Word™?

Should I have one hand on the throttle during engine ignition?

Why is regex [0-9]0,2 not greedy in sed?

Will copper pour help on my single-layer PCB?

Draw parts of a split rectangle in a dashed/dotted style

Why don't humans perceive sound waves as twice the frequency they are?

Transcendental and non-transcendental god and objectivism

How to tell readers that I know my story is factually incorrect?

Why would word of Princess Leia's capture generate sympathy for the Rebellion in the Senate?

Discontinuous Tube visualization

Could a US citizen born through "birth tourism" become President?

Integration using partial fraction is wrong

Pauli exclusion principle - black holes

Who is Jambavan an incarnation of?

Is encryption still applied if you ignore the SSL certificate warning for self-signed certs?

Why do jet engines sound louder on the ground than inside the aircraft?

Last-minute canceled work-trip means I'll lose thousands of dollars on planned vacation

Align the contents of a numerical matrix when you have minus signs

Why aren't there any women super Grandmasters (GMs)?



Empty body content when doing a PUT request to Wiki pages


Is an entity body allowed for an HTTP DELETE request?HTTP GET with request bodyHow do you set the Content-Type header for an HttpClient request?I am trying to execute REST API within powershell using invoke-restmethod/invoke-webrequest but failed when I pass Json inputsInvoke-Webrequest incorect Json format “Cannot bind parameter 'Headers' ”VSTS create service connection via APIAzure DevOps git policy configurations api broken?Source Providers - List Branches - What is the providerName?is there any way to automate policykeys creation in identityexperienceframework under azure Ad B2C tenant?Update wiki page of tfs by calling rest-api






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















Azure DevOps Services REST API 5.0 - Wiki Pages



I'm trying to dynamically update an Azure DevOps Wiki page with the newest commits on top whenever a change is introduced to a repository.
When I try to PUT the commit history into a Wiki page the content field within the body is empty.



enter image description here



The request is done via Powershell and looks like this:



function postToWiki($Commits) ConvertTo-Json

Invoke-WebRequest -Uri $wikiUrl -Headers $headers -Body $json -ContentType "application/json" -Method Put



Additional information that can be useful:



  • It works when I send simpler strings like "Hello"

  • The JSON being sent is valid according to https://jsonlint.com/.

  • The $Commit variable is pretty huge, up to 6000 lines.









share|improve this question






























    3















    Azure DevOps Services REST API 5.0 - Wiki Pages



    I'm trying to dynamically update an Azure DevOps Wiki page with the newest commits on top whenever a change is introduced to a repository.
    When I try to PUT the commit history into a Wiki page the content field within the body is empty.



    enter image description here



    The request is done via Powershell and looks like this:



    function postToWiki($Commits) ConvertTo-Json

    Invoke-WebRequest -Uri $wikiUrl -Headers $headers -Body $json -ContentType "application/json" -Method Put



    Additional information that can be useful:



    • It works when I send simpler strings like "Hello"

    • The JSON being sent is valid according to https://jsonlint.com/.

    • The $Commit variable is pretty huge, up to 6000 lines.









    share|improve this question


























      3












      3








      3








      Azure DevOps Services REST API 5.0 - Wiki Pages



      I'm trying to dynamically update an Azure DevOps Wiki page with the newest commits on top whenever a change is introduced to a repository.
      When I try to PUT the commit history into a Wiki page the content field within the body is empty.



      enter image description here



      The request is done via Powershell and looks like this:



      function postToWiki($Commits) ConvertTo-Json

      Invoke-WebRequest -Uri $wikiUrl -Headers $headers -Body $json -ContentType "application/json" -Method Put



      Additional information that can be useful:



      • It works when I send simpler strings like "Hello"

      • The JSON being sent is valid according to https://jsonlint.com/.

      • The $Commit variable is pretty huge, up to 6000 lines.









      share|improve this question
















      Azure DevOps Services REST API 5.0 - Wiki Pages



      I'm trying to dynamically update an Azure DevOps Wiki page with the newest commits on top whenever a change is introduced to a repository.
      When I try to PUT the commit history into a Wiki page the content field within the body is empty.



      enter image description here



      The request is done via Powershell and looks like this:



      function postToWiki($Commits) ConvertTo-Json

      Invoke-WebRequest -Uri $wikiUrl -Headers $headers -Body $json -ContentType "application/json" -Method Put



      Additional information that can be useful:



      • It works when I send simpler strings like "Hello"

      • The JSON being sent is valid according to https://jsonlint.com/.

      • The $Commit variable is pretty huge, up to 6000 lines.






      rest azure powershell azure-devops






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 13:17







      Jonathan Hellqvist

















      asked Mar 26 at 11:11









      Jonathan HellqvistJonathan Hellqvist

      335 bronze badges




      335 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I have the same problem today. My body contained special HTML caracters wich are not escaped in the request.



          Try to escape the special chars (éè...).
          In PowerShell, you can use the following assembly:



          Add-Type -AssemblyName System.Web
          $encodedBody = [System.Web.HttpUtility]::HtmlEncode($Commits)


          Result:




          # Construct the wiki REST URI
          # $uri = $WikiUri +$WikiPath + $($contentPackage.version)
          $uri = "$($env:WikiUri)$($contentPackage)&api-version=5.0"

          # Encode and convert to json
          Add-Type -AssemblyName System.Web
          $encodedContent = [System.Web.HttpUtility]::HtmlEncode($content)

          $data = @ Content=$encodedContent; | ConvertTo-Json;

          # Set Request
          $params = @uri = "$($uri)";
          Method = 'PUT';
          Headers = $header;
          ContentType = "application/json";
          Body = $data;


          # Call
          Invoke-WebRequest @params





          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355739%2fempty-body-content-when-doing-a-put-request-to-wiki-pages%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I have the same problem today. My body contained special HTML caracters wich are not escaped in the request.



            Try to escape the special chars (éè...).
            In PowerShell, you can use the following assembly:



            Add-Type -AssemblyName System.Web
            $encodedBody = [System.Web.HttpUtility]::HtmlEncode($Commits)


            Result:




            # Construct the wiki REST URI
            # $uri = $WikiUri +$WikiPath + $($contentPackage.version)
            $uri = "$($env:WikiUri)$($contentPackage)&api-version=5.0"

            # Encode and convert to json
            Add-Type -AssemblyName System.Web
            $encodedContent = [System.Web.HttpUtility]::HtmlEncode($content)

            $data = @ Content=$encodedContent; | ConvertTo-Json;

            # Set Request
            $params = @uri = "$($uri)";
            Method = 'PUT';
            Headers = $header;
            ContentType = "application/json";
            Body = $data;


            # Call
            Invoke-WebRequest @params





            share|improve this answer



























              0














              I have the same problem today. My body contained special HTML caracters wich are not escaped in the request.



              Try to escape the special chars (éè...).
              In PowerShell, you can use the following assembly:



              Add-Type -AssemblyName System.Web
              $encodedBody = [System.Web.HttpUtility]::HtmlEncode($Commits)


              Result:




              # Construct the wiki REST URI
              # $uri = $WikiUri +$WikiPath + $($contentPackage.version)
              $uri = "$($env:WikiUri)$($contentPackage)&api-version=5.0"

              # Encode and convert to json
              Add-Type -AssemblyName System.Web
              $encodedContent = [System.Web.HttpUtility]::HtmlEncode($content)

              $data = @ Content=$encodedContent; | ConvertTo-Json;

              # Set Request
              $params = @uri = "$($uri)";
              Method = 'PUT';
              Headers = $header;
              ContentType = "application/json";
              Body = $data;


              # Call
              Invoke-WebRequest @params





              share|improve this answer

























                0












                0








                0







                I have the same problem today. My body contained special HTML caracters wich are not escaped in the request.



                Try to escape the special chars (éè...).
                In PowerShell, you can use the following assembly:



                Add-Type -AssemblyName System.Web
                $encodedBody = [System.Web.HttpUtility]::HtmlEncode($Commits)


                Result:




                # Construct the wiki REST URI
                # $uri = $WikiUri +$WikiPath + $($contentPackage.version)
                $uri = "$($env:WikiUri)$($contentPackage)&api-version=5.0"

                # Encode and convert to json
                Add-Type -AssemblyName System.Web
                $encodedContent = [System.Web.HttpUtility]::HtmlEncode($content)

                $data = @ Content=$encodedContent; | ConvertTo-Json;

                # Set Request
                $params = @uri = "$($uri)";
                Method = 'PUT';
                Headers = $header;
                ContentType = "application/json";
                Body = $data;


                # Call
                Invoke-WebRequest @params





                share|improve this answer













                I have the same problem today. My body contained special HTML caracters wich are not escaped in the request.



                Try to escape the special chars (éè...).
                In PowerShell, you can use the following assembly:



                Add-Type -AssemblyName System.Web
                $encodedBody = [System.Web.HttpUtility]::HtmlEncode($Commits)


                Result:




                # Construct the wiki REST URI
                # $uri = $WikiUri +$WikiPath + $($contentPackage.version)
                $uri = "$($env:WikiUri)$($contentPackage)&api-version=5.0"

                # Encode and convert to json
                Add-Type -AssemblyName System.Web
                $encodedContent = [System.Web.HttpUtility]::HtmlEncode($content)

                $data = @ Content=$encodedContent; | ConvertTo-Json;

                # Set Request
                $params = @uri = "$($uri)";
                Method = 'PUT';
                Headers = $header;
                ContentType = "application/json";
                Body = $data;


                # Call
                Invoke-WebRequest @params






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jun 25 at 16:17









                JohnJohnJohnJohn

                12 bronze badges




                12 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355739%2fempty-body-content-when-doing-a-put-request-to-wiki-pages%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해