aurelia / http-client

A simple, restful, message-based wrapper around XMLHttpRequest.
MIT License
62 stars 59 forks source link

.withParams() does not serialize dates #130

Closed JeroenVinke closed 8 years ago

JeroenVinke commented 8 years ago

https://gist.run/?id=50c90cd2a73b45026209c46a3b949bd1

import {inject} from 'aurelia-framework';
import {HttpClient} from 'aurelia-http-client';

@inject(HttpClient)
export class App {
  constructor(httpClient) {
    this.httpClient = httpClient;
  }

  attached() {
    let request = this.httpClient.createRequest('https://some.unexisting.domain.name.com')
    .asGet()
    .withParams({a: 'a', b: new Date()});

    request.send();
  }
}

The b parameter is lost, while the a parameter is sent:

image

JeroenVinke commented 8 years ago

Or should we just serialize the date before passing it to .withParams() ?

EisenbergEffect commented 8 years ago

Closing this since you should probably serialize the dates to format you desire before sending.