<?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: Using Webscript to post Topic to Forum Content Type in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/using-webscript-to-post-topic-to-forum-content-type/m-p/223895#M177025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Russell,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect the problem is that you aren't setting your mime type in the header to "application/json". Alfresco handles JSON posts in a special way so if the incoming request isn't identified as JSON, the web script probably isn't snagging your data at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used curl to post your json without the mime type set and got your error. Once I set the mime type it posted successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;curl -v -X POST "&lt;A href="http://localhost:8080/alfreso/service/api/forum/node/workspace/SpacesStore/fbd4e50e-04e7-4e52-8280-928eba9e6c36/posts?alf_ticket=TICKET_1c1566368bc82e7936b41d0962ec370d1ba32547" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfreso/service/api/forum/node/workspace/SpacesStore/fbd4e50e-04e7-4e52-8280-928eba9e6c36/posts?alf_ticket=TICKET_1c1566368bc82e7936b41d0962ec370d1ba32547&lt;/A&gt;" -H "Content-Type: application/json" -d @/Users/jpotts/tmp.json&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Can you try again but this time, include the following line just before your post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;YAHOO.util.Connect.initHeader("Content-Type", "application/json");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2009 04:15:00 GMT</pubDate>
    <dc:creator>jpotts</dc:creator>
    <dc:date>2009-11-02T04:15:00Z</dc:date>
    <item>
      <title>Using Webscript to post Topic to Forum Content Type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-webscript-to-post-topic-to-forum-content-type/m-p/223894#M177024</link>
      <description>All -I am attempting to develop a little javascript application that will allow me to post a topic to a discussion forum for a content item.&amp;nbsp; In doing this, I am trying to use the /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts webscript that is installed with Alfresco.Here is my</description>
      <pubDate>Mon, 26 Oct 2009 15:50:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-webscript-to-post-topic-to-forum-content-type/m-p/223894#M177024</guid>
      <dc:creator>rhertzberg</dc:creator>
      <dc:date>2009-10-26T15:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Webscript to post Topic to Forum Content Type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-webscript-to-post-topic-to-forum-content-type/m-p/223895#M177025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Russell,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suspect the problem is that you aren't setting your mime type in the header to "application/json". Alfresco handles JSON posts in a special way so if the incoming request isn't identified as JSON, the web script probably isn't snagging your data at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used curl to post your json without the mime type set and got your error. Once I set the mime type it posted successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;curl -v -X POST "&lt;A href="http://localhost:8080/alfreso/service/api/forum/node/workspace/SpacesStore/fbd4e50e-04e7-4e52-8280-928eba9e6c36/posts?alf_ticket=TICKET_1c1566368bc82e7936b41d0962ec370d1ba32547" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfreso/service/api/forum/node/workspace/SpacesStore/fbd4e50e-04e7-4e52-8280-928eba9e6c36/posts?alf_ticket=TICKET_1c1566368bc82e7936b41d0962ec370d1ba32547&lt;/A&gt;" -H "Content-Type: application/json" -d @/Users/jpotts/tmp.json&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Can you try again but this time, include the following line just before your post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;YAHOO.util.Connect.initHeader("Content-Type", "application/json");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 04:15:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-webscript-to-post-topic-to-forum-content-type/m-p/223895#M177025</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2009-11-02T04:15:00Z</dc:date>
    </item>
  </channel>
</rss>

