<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>15 Feb 2018 19:58:54 Z</lastBuildDate><pubDate>15 Feb 2018 13:37:34 Z</pubDate><description>Hi&#13;
&#13;
I just started working with REST webservice.&#13;
&#13;
I sucessfully created created a RestWebservice with procedures to find,delete and add a record.&#13;
 &#13;
It works fine  except that in the add record procedure, when in the product_name (string field) and I have a space between 2 words then the webservice fails (return code 400/404)&#13;
&#13;
If the product name have no space the post operation works fine&#13;
&#13;
What is the matter ?  how to fix it ?&#13;
&#13;
The code to execute the webservice looks like bellow&#13;
&#13;
oRequest is restRequest // httpRequest&#13;
oResponse is restResponse //httpResponse&#13;
sprodut_name is string&#13;
sUrl_formated is string&#13;
&#13;
//   when there are spaces I a replace it  with + sign&#13;
sprodut_name=NoSpace(Replace(EDT_Product_name," ","+"))&#13;
&#13;
sUrl_formated =StringBuild("http://XXX.kalanda.info/My_rest/add_product/{%1}/{%2}/{%3}/{%4}/{%5}",EDT_Code,sprodut_name,EDT_unit,EDT_Value,EDTamount)&#13;
&#13;
oRequest..URL = sUrl_formated &#13;
&#13;
oRequest..Method = httpPost&#13;
&#13;
oRequest..ContentType = "text/plain"&#13;
&#13;
// Request content&#13;
oRequest..Content = [&#13;
	&#13;
]&#13;
&#13;
// Runs the request and retrieves the response&#13;
oResponse =RESTSend(oRequest))&#13;
&#13;
IF oResponse.StatusCode=200 THEN&#13;
	Info("Gravou "+oResponse.StatusCode)&#13;
ELSE&#13;
	Info("erro "+oResponse.StatusCode)&#13;
END&#13;
&#13;
&#13;
&#13;
Thank in advance &#13;
&#13;
Bastiaan</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice/read.awp</link><title>Problem with POST in REST WebService</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>bw</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64576/read.awp</comments><pubDate>15 Feb 2018 19:58:54 Z</pubDate><description>Hi Fabrice&#13;
&#13;
&#13;
I tried to URLencode the value of the paramenter used by the POST  webservice like bellow&#13;
&#13;
 sprodut_name=URLEn…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64576/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64576/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice/read.awp">Problem with POST in REST WebService</source><title>Re: Problem with POST in REST WebService</title></item><item><author>fromweb</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64572/read.awp</comments><pubDate>15 Feb 2018 14:22:46 Z</pubDate><description>Hi Bastiaan,&#13;
&#13;
you are probably mssing a 'urlencode' to prepare your data.&#13;
&#13;
Best regards&#13;
&#13;
-- &#13;
Fabrice Harari&#13;
Internationa…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64572/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice-64572/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/64571-problem-with-post-rest-webservice/read.awp">Problem with POST in REST WebService</source><title>Re: Problem with POST in REST WebService</title></item></channel></rss>
