corelibraries-devexpress-dot-dataaccess-dot-json-dot-urijsonsource-154bf910.md
Provides access to a collection of parameters that the UriJsonSource includes in requests to a JSON endpoint as custom HTTP headers.
Namespace : DevExpress.DataAccess.Json
Assembly : DevExpress.DataAccess.v25.2.dll
NuGet Package : DevExpress.DataAccess
[Browsable(false)]
public HeaderParameterCollection HeaderParameters { get; }
<Browsable(False)>
Public ReadOnly Property HeaderParameters As HeaderParameterCollection
| Type | Description |
|---|---|
| HeaderParameterCollection |
Lists header parameters.
|
This property stores a collection of header parameters that the UriJsonSource uses to add custom HTTP headers to JSON endpoint requests.
The parameters are added to endpoint requests in the same order in which they are stored in the collection. Change the order of elements in the collection to reposition parameters in endpoint requests.
public static JsonDataSource CreateDataSourceWithAuthenticationInCode() {
// Create a new UriJsonSource object and configure authentication data in it
var jsonSource = new DevExpress.DataAccess.Json.UriJsonSource();
jsonSource.Uri = new Uri(@"https://northwind.netcore.io/customers.json");
jsonSource.HeaderParameters.Add(new HeaderParameter("MyAuthHeader1", "secretToken1"));
jsonSource.HeaderParameters.Add(new HeaderParameter("MyAuthHeader2", "secretToken2"));
// Create JsonDataSource
var jsonDataSource = new DevExpress.DataAccess.Json.JsonDataSource() {
JsonSource = jsonSource
};
jsonDataSource.Fill();
}
Public Shared Function CreateDataSourceWithAuthenticationInCode() As JsonDataSource
' Create a new UriJsonSource object and configure authentication data in it
Dim jsonSource = New DevExpress.DataAccess.Json.UriJsonSource()
jsonSource.Uri = New Uri("https://northwind.netcore.io/customers.json")
jsonSource.HeaderParameters.Add([New] HeaderParameter("MyAuthHeader1", "secretToken1"))
jsonSource.HeaderParameters.Add([New] HeaderParameter("MyAuthHeader2", "secretToken2"))
' Create JsonDataSource
Dim jsonDataSource = New DevExpress.DataAccess.Json.JsonDataSource() With {.JsonSource = jsonSource}
jsonDataSource.Fill()
End Function
See Also