Add setting for traditional buildQueryString
buildQueryString in aurelia-path has tradidional argument which triggers different way to format query params.
Currently HttpClient doesn't have similar param, therefore I have to build the query manually and append to url instead of using withParams RequestBuilder method.
Hi @EisenbergEffect
Is it okay to add traditional flag into the signature method of withParams?
Something like the code below.
withParams(params: Object, traditional ?: boolean): RequestBuilder {
return this._addTransformer(function(client, processor, message) {
message.traditional = traditional;
message.params = params;
});
}
and also with get method
get(url: string, params?: Object, traditional?: boolean): Promise<HttpResponseMessage> {
return this.createRequest(url).asGet().withParams(params, traditional).send();
}
any thoughts?
I think it would be better to have a requestOptions argument. The property traditional will then be a property on the requestOptions object.
This way it will be easier to add/remove/modify options that might come in the future. I personally hate methods which parameter signature changes frequently or has a long list of parameters.
The method signature is somewhat the same as buildQueryString method. Also, changes do not affect existing code. The actual traditional option is included as property of AureliaHttpClient class along with other options.
Looks like traditional is now supported. This issue can now be close I believe