I Need to frame another url in the jmix application of method type "Post". How can I set that using Browser Frame or using something else in java?

I have tried using the following code but unable to get the result.

import io.jmix.ui.component.Frame;
import io.jmix.ui.component.UrlResource;
import io.jmix.ui.component.Window;
import io.jmix.ui.screen.Screen;
import io.jmix.ui.screen.UiController;
import io.jmix.ui.screen.UiControllerUtils;
import io.jmix.ui.screen.UiDescriptor;
import io.jmix.ui.screen.UrlMapping;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

@UiController(“myScreen”)
@UiDescriptor(“my-screen.xml”)
@UrlMapping(url = “/my-screen”, controller = MyScreenController.class)
public class MyScreen extends Screen {

public void navigateToUrlWithPost(String destinationUrl) throws IOException {
    Frame frame = UiControllerUtils.getScreenContext(this).getScreen().getWindow().getFrame();

    URL url = new URL(destinationUrl);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.setRequestMethod("POST");

    UrlResource resource = new UrlResource(connection);
    frame.setSource(resource);
}

}

Hi,

Can you please specify which version of Jmix you are using?

Regards,
Alex