What is it?
Navigation for remote content.
The structure is represented by the attributes below:
|url||String or Binding||✓||Navigation address.|
|shouldPrefetch||Boolean||Load the address previously.|
|fallback||Screen||Screen to be returned in case the loading fails.|
|httpAdditionalData||HttpAdditionalData||Can be used on navigation actions to pass additional http data for the requests made to the backend.|
The HttpAdditionalData object has the method, headers and body attributes.
|method||HTTPMethod||The http method to perform the request: get, put, post, delete, etc|
|headers||Map<String, String>||Header items for the request.|
|body||Any||Content to be sent in the body of the request. Can be either a string or an object that can be serialized to a JSON string|
How to use it?
Button( onPress = listOf( Navigate.PushView( route = Route.Remote( url = "/present/view", httpAdditionalData = HttpAdditionalData( method = HttpMethod.POST, headers = mapOf("test" to "test"), body = mapOf("framework" to "Beagle") ) ) ) ), text = "Click me!" )
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.