Angular 2 / AJAX. How to Http.post to send a file to a server?

225 views
Skip to first unread message

JG

unread,
Jan 20, 2016, 10:45:57 AM1/20/16
to AngularJS
Angular 2 Http post API (post(url: string, body: string, options?: RequestOptionsArgs)) expects a body to be a string. I need to use FormData() to post a file to the server. As a workaround, I am using jQuery, but I don't like mixing Http and jQuery in one application to make AJAX calls. Any suggestions?
Reply all
Reply to author
Forward
0 new messages