index abstract method
Handles the primary request processing for this route handler. This method serves as the main entry point for processing HTTP requests when no specific action is specified. It should contain the core logic for handling the request and generating an appropriate respons The method is called by the routing system when a request matches the associated route pattern. Implementations should:
- Process the request according to business logic
- Generate and return response content
- Handle any errors appropriately
Returns a Future<String> containing the response content. This could be:
- HTML content for web pages
- JSON data for API endpoints
- Redirect responses
- Error messages
- Empty string for no-content responses
Example implementation:
@override
Future<String> index() async {
final data = await service.getData();
return RequestContext.rq.renderJson(data);
}
Implementation
Future<String> index();