Microsoft Bot Composer Send an HTTP request does not accept variable as Url input - httprequest

Versions
Bot Composer version: 4.7.0-preview-191208-1
fresh project
yarn command triggered as in docs
Latest Chrome and Edge (chromium) stable version on Windows 10 Pro
Issue
The 'Send an HTTP request' Url field no longer seems to accept a variable as input for me. For example:
${getmyurl()}
The validation seems OK:
Where the getmyurl looks something like (it's not an escaping issue, I tried multiple values here with and without quotes etc...):
# getmyurl()
- just-a-test-string-to-see-if-this-throws-an-invalid-url-exception
The response in the 'Bot Framework Emulator' always gives the message:
BuildQnaAnwserUrl does not have an evaluator, it's not a built-in function or a custom function.
This used to work for me with an older version of the Composer (where the prefix was still an #). Is anyone else having this, is my syntax incorrect somehow?

You can save the Url in a variable at start of conversation. eg. Set a property -> user.Url : urlString. In http method Url field -> Pass it as ${user.Url}. The scope of variable can be defined as per requirement (user/conversation/dialog/turn)
Send an HTTP request

Related

PhpStorm HTTP Client how can I get the actual request body after substituting dynamic variables?

When I use PhpStorm HTTP Client to send requests, I can see the full response body auto-saved to a file, and I can display or copy it.
My question is, how do I get the actual request body (like the response) after substituting dynamic variables?
I'm using PhpStorm v2022.2.4 , with HTTP Client plugin v. v222.4459.28
I'm using PhpStorm v2022.2.4 , with HTTP Client plugin v. v222.4459.28
The functionality you are after was implemented just recently (see the tickets below) and should be available in just released 2022.3 version. Please upgrade your PhpStorm to the latest 2022.3 version and check it there.
Recently implemented tickets with related functionality:
https://youtrack.jetbrains.com/issue/IDEA-291393
https://youtrack.jetbrains.com/issue/IDEA-230756
https://youtrack.jetbrains.com/issue/IDEA-257965

Downloading SetupTools in Maximo/Jython fails with HTTP error 403 SSL is required

Appendix A of The Definitive Guide to Jython describes downloading SetupTools for use with Jython.
https://jython.readthedocs.io/en/latest/appendixA/
This indicates to me that it should be possible to download and use SetupTools from within a Jython automation script in Maximo (v7.6 in my case). The book points us to the following url to copy a Jython script that will do this:
http://peak.telecommunity.com/dist/ez_setup.py
I add one line to the above script to call the function "use_setuptools":
use_setuptools()
Then I create a push button on a Maximo application and associate the aforementioned script with the button press I get the following error:
System Message BMXAA7837E - An error occured that prevented the
EZ_SETUP script for the EZ_SETUP launch point from running.
urllib2.HTTPError: HTTP Error 403: SSL is required in at line
number 280
The stack trace points to the following line in the function "download_setuptools" which is called by "use_setuptools":
src = urllib2.urlopen(url)
This appears to be because the url requested, in my case:
http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
...is redirected a few times before arriving at the following url:
https://files.pythonhosted.org/packages/98/d3/ed3bc7e3f4b143092862dab99d984261ac4be6a40d4fb1e66d2a10e9ea99/setuptools-0.6c11-py2.5.egg
Note the url uses HTTPS not HTTP. The following indicates why this may be so:
https://sourceforge.net/p/pypi/support-requests/300/
The jython.jar included with Maximo does not include the ssl module so we could either:
Download the ssl module manually and copy it to the correct location on the server.
Download the appropriate egg file manually over HTTPS and copy it to the correct location on the server.
Bypass the problem by creating a mirror for the file we're looking for that is accessible over HTTP and use that url in the code.
Whilst these are feasible I'd prefer to modify the code to ignore the SSL certificate if possible, however all the workarounds on StackOverflow and elsewhere seem to require that you're able to "import ssl" in order to bypass it which rather seems to defeat the purpose.
Ideally I'm looking for a solution that modifies the code from the url provided above to get it to work with Maximo/Jython 2.5.2 and doesn't require downloading and adding new modules or packages and all that this entails with Maximo. Bypassing or temporarily disabling ssl is fine as the code checks the hash of the downloaded .egg file. This would be my preferred solution if possible.
In my experience, automation scripting works best if you can stay "as Java as possible" and "as Maximo as possible". So, I would use the LIB_HTTPCLIENT script from the Scripting 76 Features document (the first example code, whose name is given by inference in the second bit of code) to try to download the SetupTools.
In case that document moves again, here is the LIB_HTTPCLIENT script. Note that the url variable is expected to be passed to this library script by the calling script.
from psdi.iface.router import HTTPHandler
from java.util import HashMap
from java.util import String
handler = HTTPHandler()
map = HashMap()
map.put("URL",url)
map.put("HTTPMETHOD","GET")
responseBytes = handler.invoke(map,None)
response = String(responseBytes,"utf-8")

Jmeter Illegal character found in host: '/' ISSUE

I tried to install Jmeter on my colleague computer when I executed http request.He has been showing this error, but I found that there is no such error in my computer. I wonder if anyone has encountered a similar problem?
My
My1
My2
Colleague
colleague1
colleague2
--
error message
java.net.MalformedURLException: Illegal character found in host: '/'
at java.base/java.net.URL.<init>(URL.java:480)
at java.base/java.net.URL.<init>(URL.java:360)
at java.base/java.net.URL.<init>(URL.java:383)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getUrl(HTTPSamplerBase.java:1053)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1231)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1220)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.base/java.lang.Thread.run(Thread.java:830)
This problem occurs when using the http request sampler, putting '/' at the end of the Server Name or Ip textbox. It will work if you delete the '/' character at the end of the host information and add it to path.
This www.amazon.com/ref=nav_logo is not a valid hostname
Valid characters for hostnames are ASCII(7) letters
from a to z, the digits from 0 to 9, and the hyphen (-). A hostname
may not start with a hyphen.
In any case your URL query string is not correct, it should look like:
https://www.amazon.com/?ref=nav_logo
^mind this character
So correct HTTP Request sampler configuration would be:
Resulting into the following request observable via View Results Tree listener
Going forward be aware that you can build a JMeter Test Plan using HTTP(S) Test Script Recorder or JMeter Chrome Extension
Even though I cannot tell you why the test behaves differently on your machine vs that of your colleaugue (I would guess that you probably chose different client implementations in the advanced section of the HTTP Request Sampler), you should definitely consider what part of your URL is:
Protocol
Server Name or IP
Path
Parameter
and use the corresponding fields in JMeter accordingly.
Hint: "/ref=nav_logo" is most definitely NOT part of the Server Name.
I faced this issue and it was for simple reason. in the server name/ip address instead giving only the severname/ip address i.e server1 i had accidentally included the https://server1 and spend two hours to resolve it

Setting ColdFusion variables during a HTTP request

I'm currently working on the acknowledge receipt response used in SagePay on my website. I've noticed you can do things such as invoke components, read and output variables, but it doesn't allow you to set variables - even if those variables already exist. Is this the case with all HTTP requests or am i simply doing something wrong? My first thought would be if it can execute server side script then surely setting variables (session i must state - not local) should not be an issue.

$_POST undefined from remote server POST

I am writing a Drupal 7 module which is listening for HTTP POST messages to be sent by a 3rd party remote application. For testing I am sending messages using the Firefox Poster extension.
If I POST the message, the following code fails to place any value in my local vars (I get 'undefined index'):
$transId = urldecode($_POST['c2s_transaction_id']);
However, if I send the message using GET, the vars get populated fine with the following code:
$transId = urldecode($_REQUEST['c2s_transaction_id']);
This is true on both my local WAMP setup and on a shared hosting package.
I have never worked with HTTP POST messages before and have no idea where the problem might be. Could it be Drupal, the web server, or my code? Can anyone suggest how I might resolve this?
Many thanks,
Polly
Drupal removes the $_POST/$_GET in the system, just use $_REQUEST instead.