---
title: "Feature: #101970 - Ajax API accepts native URL and URLSearchParams objects as arguments"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-101970-1695205584"
source: "Changelog/13.0/Feature-101970-AJAXAPIAcceptsNativeURLAndURLSearchParamsObjectsAsArguments.rst"
typo3-version: "13.0"
typo3-major: 13
type: "feature"
issue: 101970
forge: "https://forge.typo3.org/issues/101970"
tags: ["JavaScript", "ext:core"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #101970 - Ajax API accepts native URL and URLSearchParams objects as arguments {#feature-101970-1695205584}

See [forge#101970](https://forge.typo3.org/issues/101970)

## Description {#description}

The Ajax API (`@typo3/core/ajax/ajax-request`) has been enhanced to accept
native URL-related objects.

## Impact {#impact}

The constructor now accepts a `URL` object as argument, along with the
already established `string` type. Also, the `withQueryArguments()` method
accepts an object of type `URLSearchParams` as argument.

### Example {#example}

```javascript
import AjaxRequest from '@typo3/core/ajax/ajax-request.js';

const url = new URL('https://example.com/page/1/2/');
const queryArguments = new URLSearchParams({
    foo: 'bar',
    baz: 'bencer'
});

const request = new AjaxRequest(url).withQueryArguments(queryArguments);
request.get().then(/* ... */);
```
