getSectionsLeadWithHttpInfo method

Future<Response> getSectionsLeadWithHttpInfo(
  1. String title, {
  2. bool? redirect,
  3. String? acceptLanguage,
})

Get mobile-optimized HTML lead section and metadata for a title.

Retrieve the lead section of the latest HTML for a page title optimised for viewing with native mobile applications. Stability: deprecated Here you can find more information about the endpoint deprecation. Please follow wikitech-l or mediawiki-api-announce for announcements of breaking changes.

Note: This method returns the HTTP Response.

Parameters:

  • String title (required): Page title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

  • bool redirect: Requests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.

  • String acceptLanguage: The desired language variant code for wikis where LanguageConverter is enabled. Example: sr-el for Latin transcription of the Serbian language.

Implementation

Future<Response> getSectionsLeadWithHttpInfo(
  String title, {
  bool? redirect,
  String? acceptLanguage,
}) async {
  // ignore: prefer_const_declarations
  final path =
      r'/page/mobile-sections-lead/{title}'.replaceAll('{title}', title);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (redirect != null) {
    queryParams.addAll(_queryParams('', 'redirect', redirect));
  }

  if (acceptLanguage != null) {
    headerParams[r'Accept-Language'] = parameterToString(acceptLanguage);
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}