Java Action return System.HttpResponse

Hi,  I am new in Mendix, now I have a microflow and I wish to create a java action, take a string as parameter and return me a System.HttpResponse. The microflow itself will be act as a http rest endpoint. But however in my generated Java Action, the code show I need to return IMendixObject, I have no clue how I can import and use System.HttpResponse。 Code show as below: @Override     public IMendixObject executeAction() throws Exception     {         // BEGIN USER CODE         //throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");         // END USER CODE     }
1 answers

Can you not use the existing built in Mendix REST functionality? You can assign a microflow to an endpoint and that gives you the ability to change the HTTPResponse as a Mendix entity.

If you want to write a REST service entirely in Java you will need to look at writing a RequestHandler. These have their place, but I would really recommend looking at using the built in functionality where possible to keep your app maintainable.