Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12787

PUT content with text/plain on a page in REST API remove the CR/LF

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.3
    • 7.3-milestone-2
    • REST
    • None
    • Unknown
    • N/A
    • N/A

    Description

      I the following tests, I use the file

      Hello
      world!
      

      If trying to put a content,

      curl \
        --verbose \
        --user Admin:admin \
        --request PUT \
        --header 'Content-type: text/plain' \
        --data-binary "@file.txt" \
        "http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/TestPlain"
      

      result is

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <page xmlns="http://www.xwiki.org">
        <link href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox" rel="http://www.xwiki.org/rel/space"/>
        <link href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/TestPlain/history" rel="http://www.xwiki.org/rel/history"/>
        <link href="http://localhost:8080/xwiki/rest/syntaxes" rel="http://www.xwiki.org/rel/syntaxes"/>
        <link href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Sandbox/pages/TestPlain" rel="self"/>
        <link href="http://localhost:8080/xwiki/rest/wikis/xwiki/classes/Sandbox.TestPlain" rel="http://www.xwiki.org/rel/class"/>
        <id>xwiki:Sandbox.TestPlain</id>
        <fullName>Sandbox.TestPlain</fullName>
        <wiki>xwiki</wiki>
        <space>Sandbox</space>
        <name>TestPlain</name>
        <title>TestPlain</title>
        <parent/>
        <parentId/>
        <version>4.1</version>
        <author>XWiki.Admin</author>
        <xwikiRelativeUrl>http://localhost:8080/xwiki/bin/view/Sandbox/TestPlain</xwikiRelativeUrl>
        <xwikiAbsoluteUrl>http://localhost:8080/xwiki/bin/view/Sandbox/TestPlain</xwikiAbsoluteUrl>
        <translations/>
        <syntax>xwiki/2.1</syntax>
        <language/>
        <majorVersion>4</majorVersion>
        <minorVersion>1</minorVersion>
        <created>2015-11-09T10:34:09+01:00</created>
        <creator>XWiki.Admin</creator>
        <modified>2015-11-09T11:07:53+01:00</modified>
        <modifier>XWiki.Admin</modifier>
        <comment/>
        <content>Helloworld!</content>
      </page>
      

      Attachments

        Activity

          People

            jsimard Jean SIMARD
            jsimard Jean SIMARD
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: