Dynamically generate url for HTTP source

我与影子孤独终老i 提交于 2019-12-12 23:27:29

问题


I'm trying to call a http endpoint. For that I need to specify a url that uses a query string to filter data.

Sample URL: http://example.com?date=2017-10-04T22:18.007Z

I need to use the current system time as a value for date query string.

I created a script and assigned the generated url with the current datetime to a variable. However, when I assigned that variable for the url field in the source HTTP definition, it did not resolve the variable.

Is there a way to solve this issue?


回答1:


I do this all the time. As long as your script is running properly (you can test that with the test feature on the script), you are writing the URL value to a global variable (something like $URL), and you are writing that global variable out in your target (something like [URL]), it should work.

If you want to show your script (just where you are creating the URL), and your target URL field that could help narrow down the problem.



来源:https://stackoverflow.com/questions/46597407/dynamically-generate-url-for-http-source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!