Webhook in EasyMorph Server - how to "run" URL without opening the EasyMorph Server task log page?

Hello,

I would like to show in a demo how by clicking a certain URL, a task can be triggered, that gives a certain ouput file.

However, when I click on this URL, it also opens the EasyMorph Server site and shows the log of the task that is being started.

I would be interested in clicking on the URL, and that no EasyMorph Server page opens, just that the task gets launched in the background. Is there a non-coding way to achieve this?

Thanks very much,

Roberto

If you click a link, the browser will always expect a response to render. That’s how browsers work. It’s not possible to suppress in a browser a response to a click without coding.

However, with a bit JS scripting, you can set a JS function to be called when the link is clicked. The function can make an HTTP request and ignore the response.

Check out online tutorials on capturing clicks and sending HTTP requests with JS script.

Hello!

I was able to send a GET request using code. The response I get back from EasyMorph Server is Status=Found, Code=302:

What does this 302 as a response mean? Are there other responses that EasyMorph Server can give, to know that the task URL was correct and EasyMorph Server has actually executed it?

Thanks,

Roberto

Hi @roberto

HTTP 302 is an url redirection to another page. Try to enable automatic redirection handler in your http clinet.

https://en.wikipedia.org/wiki/HTTP_302
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302

Hello!

Thanks for your response, but I don’t really understand - the EasyMorph task gets triggered, so it all works, but I’m wondering why the response back from Server is 302 and not 200. Why is a URL redirection taking place?

Thanks,

Roberto

Hi @roberto

That’s because the Server does a redirect to the task run log.

1 Like

Ok understood, thanks!

Hello @ckononenko,

If the Server does the redirect to the task run log, then a 302 code is expected, right? Is there a way to get the 200 response code when launching EasyMorph server tasks using the GET Request URL?

Thanks,

Roberto

Hi @roberto

If the Server does the redirect to the task run log, then a 302 code is expected, right?

Yes, you’re right.

Is there a way to get the 200 response code when launching EasyMorph server tasks using the GET Request URL?

Currently, it’s not possible.
Could you please, describe the expected behavior? So we’ll discuss it.

1 Like

Ok, thanks for the information.

If 302 is what is to be expected, that works for me.