1e41f4b71Sopenharmony_ci# Common Library Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciCompared with OpenHarmony 3.2 Beta4, OpenHarmony 3.2.10.1(MR) has the following API changes in the URL module of the common library subsystem. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci## cl.commonlibrary.1 URLParams Class Changes 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciThe constructor function of the **URLParams** class in the URL module of the common library subsystem is changed. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ciSpecifically, **constructor(init?: string[][] | Record<string, string> | string | URLSearchParams)** is changed to **constructor(init?: string[][] | Record<string, string> | string | URLParams)**, and the parameter type is changed from **URLSearchParams** to **URLParams**. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciYou need to adapt your application. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci**Change Impacts** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Key API/Component Changes** 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enum/Constant | Change Type| 20e41f4b71Sopenharmony_ci| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | 21e41f4b71Sopenharmony_ci| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLSearchParams) | Deleted | 22e41f4b71Sopenharmony_ci| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLParams)| Changed 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci**Adaptation Guide** 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ciThe following illustrates how to create a **URLParams** object in your application. 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ciExample: 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci```ts 31e41f4b71Sopenharmony_ciimport url from '@ohos.url' 32e41f4b71Sopenharmony_citry { 33e41f4b71Sopenharmony_ci let params1 = new Url.URLParams('?user=abc&query=xyz') 34e41f4b71Sopenharmony_ci let params2 = new Url.URLParams(params1) 35e41f4b71Sopenharmony_ci var result= params2.toString() 36e41f4b71Sopenharmony_ci console.log(result) //"user=abc&query=xyz" 37e41f4b71Sopenharmony_ci} catch (err) { 38e41f4b71Sopenharmony_ci console.error(`Fail to ceate URLParams.codeis${err.code},message is ${err.message}`); 39e41f4b71Sopenharmony_ci} 40e41f4b71Sopenharmony_ci``` 41e41f4b71Sopenharmony_ci## cl.commonlibrary.2 URL Attribute Changes of URLParams Class APIs 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ciThe URL attributes of the URL module in the common library subsystem are changed. 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ciSpecifically, the **searchParams: URLSearchParams** attribute is deprecated, and the **params: URLParams** attribute is added. 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ciYou need to adapt your application. 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ci**Change Impacts** 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ciJS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci**Key API/Component Changes** 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enum/Constant | Change Type| 56e41f4b71Sopenharmony_ci| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | 57e41f4b71Sopenharmony_ci| @ohos.url | URL | searchParams: URLSearchParams; |Deprecated (in API version 9)<br> | 58e41f4b71Sopenharmony_ci| @ohos.url | URL | params: URLParams; | Added | 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci**Adaptation Guide** 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ciThe following illustrates how to create a **URLParams** object in your application. 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ciExample: 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci```ts 67e41f4b71Sopenharmony_ciimport url from '@ohos.url' 68e41f4b71Sopenharmony_cilet that = new Url.URL('http://username:password@host:8080/directory/file?Hello=china#qwer=da') 69e41f4b71Sopenharmony_cilet params = that.URLParams 70e41f4b71Sopenharmony_civar result = params.toString() 71e41f4b71Sopenharmony_ciconsole.log(result) //%E4%BD%A0%E5%A5%BD=china 72e41f4b71Sopenharmony_ci``` 73