2

How can I do a HTTP get request and pass an JSON Object.

When I used Angular Datatable - Server side the Angular way, they are using a post request:

this.http.post<DataTablesResponse>(
   'https://angular-datatables-demo-server.herokuapp.com/',
   dataTablesParameters, {}
)

For some reason, i would like to use get request. So how to do that in a get request?

The dataTablesParameters is a JSON Object, something like:

{
    "order": [{
        "column": 0,
        "dir": "asc"
    }],
    "start": 0,
    "length": 10,
    "search": {
        "value": "",
        "regex": false
    }
    ...
}

here is what i tried:

this.http.get<DataTablesResponse>(
      '/dashboard/roles/?format=datatables', 
      {params: dataTablesParameters}
    )

but i am unable to access values of search parameter?

suhailvs
  • 20,182
  • 14
  • 100
  • 98

0 Answers0