我在使用restAPI访问包含"#“或"/”的标记的插值数据时遇到了困难。我能够得到所有其他标签的内插数据。
例如使用tagName: Tag123#Value访问插值数据
oauth.get("https://<server>:8443/historian-rest-api/v1/datapoints/interpolated/Tag123%23Value/<starttime>/<endtime>/0/60000")返回
error code 400 - request was malformed.但是,我能够获得Tag123#Value的当前值。
oauth.get("https://<server>:8443/historian-rest-api/v1/datapoints/currentvalue?tagNames=Tag123%23Value")注意:我已经对标记进行了URI编码,这使我能够检索当前值-但是我怀疑这个问题与URI编码有关.
发布于 2022-07-15 08:28:57
根据我的经验,设置Python脚本以通过procincy史学家rest api请求数据,您应该能够将所有反斜杠()转换为收敛(*):
https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test\tag_with\\weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000给出:404个卷曲错误
https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test%5Ctag_with%5C%5Cweirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000提供:未找到标记
https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test*tag_with**weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000提供:我正在寻找的查询数据
注意:从我能够尝试的调试打印中,我注意到在curl中,反斜杠被翻译成前面的斜杠,所以它尝试使用第一个链接作为输入:https://<historianservername>:8443/historian-rest-api/v1/datapoints/interpolated/test/tag_with//weirdcharch/2022-5-9T01:13:00.0Z/2022-5-10T:01:13:00.0Z/0/600000,这是导致404错误的原因。
编辑:请注意,这是在专业历史学家版本9.0!
https://stackoverflow.com/questions/56188384
复制相似问题