Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Support passing FormData as data to http requests. #1126

Closed
wants to merge 162 commits into from
Closed

Support passing FormData as data to http requests. #1126

wants to merge 162 commits into from

Conversation

bgourlie
Copy link
Contributor

@bgourlie bgourlie commented Jun 9, 2014

Fixes #1116
Fixes #1125

When passing a FormData object to Dart's built-in HttpRequest.request method, it will set content-type accordingly: Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryfuRomRQ2mNCfdxYb

This PR does two things:

  • Prevents the HttpService from attempting to serialize FormData as JSON
  • Do not apply default Content-Type header if the data being sent is a FormData object, and instead, remove any content-type header so that a proper one containing the boundary will be added by the dart's internal plumbing.

@mhevery
Copy link
Contributor

mhevery commented Jul 23, 2014

Hi @bgourlie, sorry it took so long to get to this PR. We were having performance code yellow, but we are now out and getting back to development. This PR looks nice, and we would like to include it, but as it stands now there are no tests. Could you add some, so that we can get it merged.

@bgourlie
Copy link
Contributor Author

Hey no prob. I'll be out on vacation the next week, I should be able to add tests once I'm back.

jbdeboer and others added 20 commits August 4, 2014 09:14
Also included is a script to launch Chrome Canary with the appropriate flag to
enable manual garbage collection.

Closes #1133
Changed instance of "xhange" to "change"
This sped up the TreeComponent benchmark by 6%.

Closes #1134
This commit adds a karma setup with a spec file for bp.js, and
has refactored bp.js to expose all functions on a global "bp" object.

Behavior of functions hasn't changed, other than to remove some
duplication of code regarding adding buttons to the DOM.
…nly the last 20

This commit also breaks the functionality into smaller, more testable functions,
and adds some basic tests for the benchmarking too.
BREAKING CHANGE:

Previously a micro task registered in flush phase would cause a new
digest cycle after the current digest cycle. The new behavior
will cause an error.

Closes #984
BREAKING CHANGE:

Microtasks scheduled in flush will process in current cycle, but they 
are not allowed to do model changes.

Microtasks scheduled in digest will be executed in digest, counting
towards the ScopeDigestTTL.
Move creation of HTML elements into tree.html where possible.

Improve styling with bootstrap lib plus basic structuring of content.
This slightly reduces number of Maps in the system.
This change reduces the number of Maps in the heap on binding heavy views by 30%.
 * Increase default sample from 10 to 20
 * Convert sample adjuster from range to input
 * Make sample list scrollable after 250px height
pavelgj and others added 27 commits August 4, 2014 09:16
BREAKING CHANGE

Previously, vetoing was allowed on leave (RouteLeaveEvent) which caused
issues because routes had no way to recover from other route vetoing a leave
event.

Now, similar to preEnter and enter, leave event was split into vetoable
preLeave (RoutePreLeaveEvent) and non-vetoable leave (RouteLeaveEvent).

    views.configure({
      'foo': ngRoute(
          path: '/foo',
          preLeave: (RoutePreLeaveEvent e) {
            e.allowLeave(new Future.value(false));
          })
    });

Closes #1070
…d views"

This reverts 59323da.

Without a default implementation for DirectiveInjector, this results in
a runtime exception (no provider found.)

Issue #1244
Some clients do not generate static factories for test code, and instead
directly depend on TestBed constructor. This commit adds a new
constructor is basically the injector factory method, requiring only
injector vs a full set of parameters.

Once clients have been moved to use fromInjector method (or even better
a transformer run for test code), we can change the constructor
dependencies in a non-breaking way.

Closes #1271
Angular's pubspec for intl spans versions with breaking changes.  For
Angular, a change in date formatting would be a breaking change but
changes do to CLDR updates are not breaking changes.  This commit
updates a test to swap out a locale with a CLDR update to one that
wasn't updated to enable it to pass across the CLDR breaking change.

Closes #1203
in _recordAdd(), previous could never be null as the list is never empty
(it has at least a marker).
in _recordRemove(), when the list is composed of a single record, it
must be the record we're trying to remove (and we assert that).

Closes #1256
Fixes #1128
Closes #1132

The insertBefore argument is never used in the current code
(see the v0.13.0 tag for the exact history of this version)
@bgourlie
Copy link
Contributor Author

bgourlie commented Aug 8, 2014

Heh, kinda messed up this PR. Closing, will resubmit with tests.

@bgourlie bgourlie closed this Aug 8, 2014
@bgourlie bgourlie deleted the support-formdata branch August 8, 2014 19:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

Headers applied by HttpDefaultHeaders service breaks multipart content requests. HTTP Service doesn't support sending FormData