submit method

Future<void> submit(
  1. String siteUrl,
  2. String feedpath, {
  3. String? $fields,
})

Submits a sitemap for a site.

Request parameters:

siteUrl - The site's URL, including protocol. For example: http://www.example.com/.

feedpath - The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml.

$fields - Selector specifying which fields to include in a partial response.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<void> submit(
  core.String siteUrl,
  core.String feedpath, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'webmasters/v3/sites/' +
      commons.escapeVariable('$siteUrl') +
      '/sitemaps/' +
      commons.escapeVariable('$feedpath');

  await _requester.request(
    url_,
    'PUT',
    queryParams: queryParams_,
    downloadOptions: null,
  );
}