Hi
I just started working with REST webservice.
I sucessfully created created a RestWebservice with procedures to
find,delete and add a record.
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)
If the product name have no space the post operation works fine
What is the matter ? how to fix it ?
The code to execute the webservice looks like bellow
oRequest is restRequest // httpRequest
oResponse is restResponse //httpResponse
sprodut_name is string
sUrl_formated is string
// when there are spaces I a replace it with + sign
sprodut_name=NoSpace(Replace(EDT_Product_name," ","+"))
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)
oRequest..URL = sUrl_formated
oRequest..Method = httpPost
oRequest..ContentType = "text/plain"
// Request content
oRequest..Content = [
]
// Runs the request and retrieves the response
oResponse =RESTSend(oRequest))
IF oResponse.StatusCode=200 THEN
Info("Gravou "+oResponse.StatusCode)
ELSE
Info("erro "+oResponse.StatusCode)
END
Thank in advance
Bastiaan