Hi Team -
Since all web request tools are slightly different I wanted to make sure I had clarity as I construct requests.
On Authentication I see Basic or Windows Integrated. In many cases I work with its a Bearer Token.
Today if I were to run this via CURL I’d setup a process to grab that token store as a variable and then pass it through. How should this be accomplished now that web requests are built in?
currently 4 scenarios are supported:
- Append a URL parameter (or parameters) with token to every web request. In this case the token has to be specified in the Web Location connector properties.
Add a header (or headers) with token to every web request. In this case the token should be specified in the “Headers” tab of the Web Location connector, similarly to the previous case.
Web-form authentication, and cookie-based sessions. In this case, initial authorization is done via a web request with authorization through request body (see below). In this case, the body will have Content-Type
application/x-www-form-urlencoded set automatically. Session cookies that come in the response are placed in the cookie container that is shared with all following web requests during project execution. If subprojects/modules are called, the cookie container is passed to them too, so that session cookies are available there too.
- Basic HTTP authentication. In this case username and password should be specified in the Web Location connector properties. Again, session cookies are set in the cookie container that remains during project execution.
Of course, a URL parameter or header with a token can be added in every web-request manually. It’s just no so convenient.
@adambeltz, please post if you were successful in connecting / inter-operating with an external API using Web Requests. Can’t wait to see if it works in real-life scenarios
Sure thing. I’m away from my computer for the morning but I’m looking forward to trying this out. I have an integration project I am working on with Magento 2 and Im looking forward to trying this out.
I’ll post back some examples as well.
The Web Request Action work also on HTTPS request ?
For me i got this error:
Error: An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel.
Source: action “Web request”, table “request with curl”
It should work with HTTPS too. Can you post (or send to firstname.lastname@example.org) a screenshot of your Web Location connector?
Are you able to establish connection to the same endpoint using curl or some other tool?
Also, do you use a proxy?
@sradum, I just made a sample project that uses both Web Request and Iterate Web Request actions to access this forum’s API via HTTPS. See here: Example: use of Web Request and Iterate Web Request with the Community forum API
We already use a Run Program transformation with curl.
Same error also in your example. From cmd with curl the URL from your example it is fine.
Hi @dgudkov -
In doing a basic connection test it was successful.
Just as a call out. I’m loving the troubleshooting features as well. As an example I had a poorly defined request and I was able to quickly see what the problem was. Then the output file is very clean.
****** moved from #lounge to #uncategorized