Skip to content

Default Content-type entity header for JSON differs between Angular vs AngularJs  #31563

Description

@PrimosK

IMPORTANT
This is not necessarily a bug. Primarily I am just trying to gather some additional information about different behaviour of AngularJs ($http) and Angular (HttpClient) APIs.

Please note that I've asked the same question on SO and Gitter but haven't received any answers so I decided to ask it there:

In AngularJs the default Content-type for JSON request is set like:

Content-Type: application/json; charset=UTF-8

This is the part of the AngularJs code that does it:

http.js

... and this is the commit in which charset=UTF-8 parameter was added:

angular/angular.js@10f80d7

Now in the case of Angular only

Content-Type: application/json

is used:

xhr_backend.ts

Side note:
We've noticed this when migrating from AngularJs ($http) to Angular (HttpClient).

Does anyone know why this difference?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: common/httpIssues related to HTTP and HTTP Clientfreq1: lowtype: bug/fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions