REST API Spaces
2020-09-10
Hi,

I am trying to update supplier (CUVc) via REST API (PATCH)

I have problem with white spaces and diacritical marks (eg. ą ę ż)

Below there is powershell command which I use to update CUVc rekord.



Space:
(curl "http://127.0.0.1:1300/api/F01/CUVc/10065?set_field.InvAddr0=street abc" -Method PATCH -Credential $cred -ContentType "application/x-www-form-urlencoded; charset=utf-8").RawContent

Space replaced by %20
(curl "http://127.0.0.1:1300/api/F01/CUVc/10065?set_field.InvAddr0=street%20abc" -Method PATCH -Credential $cred -ContentType "application/x-www-form-urlencoded; charset=utf-8").RawContent

Here is Hansa answer:


HTTP/1.1 200
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: text/xml; charset=UTF-8
Date: Thu, 10 Sep 2020 15:45:43 GMT
Last-Modified: Thu, 10 Sep 2020 15:45:43 GMT






743191D1-04359537-9E824BAF-3F39E624-361C6268
1
10065
TEST TEST
street%20abc <--here is problem with spaces
35-233 Rzeszów ą ę
20021
03

1
...





Here are similar problems:
https://forum.hansaworld.com/eng/StandardERPForum/viewmessage/5102/8353668
https://forum.hansaworld.com/us_en/StandardERPForum/viewmessage/5102/8353774


I have attached picture from hansa client with white space problem.

J.

Files are pending for approval
Richard Saunders
2020-09-21
Hi J,

In general URL's cannot handle spaces. It replaces space with corresponding character in this case %.

You would need to URLEncode() special characters.

url = "http://127.0.0.1:1300/api/F01/CUVc/10065?set_field.InvAddr0=" & URLEncode("street abc");

If you are receiving back street%abc as pictured in your screenshot, then you need to URLDecode that string to get "street abc" in Standard ERP.

Hope this helps.

Regards,

Richard Saunders
该话题已关闭,无法再评论。请新建话题。
返回到列表
最新留言
Hi there, There is currently no GUI client for Linux. Only a server version is available. Than...
17:35 3 九月 2025
Hi, When I add a labour service item (cost 10 per Hr) to production, the NL posting is incorrect....
08:10 19 八月 2025

我们在正常工作时间对论坛进行维护,旨在24小时内回复所有问题

您可以通过选择主题列表右上角的 "星星 "图标来订阅本论坛的任何帖子的通知。你必须登录后才能使用这一功能。