Giter VIP home page Giter VIP logo

Comments (8)

jimmywarting avatar jimmywarting commented on June 15, 2024 1

Btw, v3 (released today) now sets the correct content-type header in fetch and xhr if not specified
also calls _blob() transparently. Maybe you want to try to update the version?

from formdata.

jimmywarting avatar jimmywarting commented on June 15, 2024

Emh... why dose it say content type application/json?

can you show some code?

from formdata.

petewins avatar petewins commented on June 15, 2024

This is for an angular project

Import * as _FormData from 'formdata-polyfill';

let data = new _FormData();
let native = new FormData();

console.log('polyfill formdata, data);
console.log('native browser formdata', native);

from formdata.

spoike avatar spoike commented on June 15, 2024

@petewins The error you get is hinting that you can't send form data as JSON data rather than what the server expects. How do you send data to your server?

Form data (if implemented through form only) is by default POSTed with application/x-www-form-urlencoded set as Content-Type. Better check your server implementation.

from formdata.

jimmywarting avatar jimmywarting commented on June 15, 2024

Nah @spoike , FormData is normally sent with content type:
multipart/form-data; boundary=----xxxx'

If You send body = new URLSearchParams() you would get x-www-form-urlencoded

from formdata.

petewins avatar petewins commented on June 15, 2024

@jimmywarting updated and working

from formdata.

jimmywarting avatar jimmywarting commented on June 15, 2024

Woop woop, no open issues or PR everything is just perfect

from formdata.

anwar101 avatar anwar101 commented on June 15, 2024

hi all ,

I updated to V3 and same issue occur with me when send angular http post request
Content-Type: application/json; charset=utf-8 ?

Please Advise

from formdata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.