You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! The following requests fails to send x-www-form-urlencoded payload:
import{URLSearchParams}from'url';import{$fetch,fetch}from'ohmyfetch';(asyncfunctionmain(){constbody=newURLSearchParams({test: 'true'});constresponseA=await$fetch('https://httpbin.org/post',{method: 'POST', body });console.log(responseA);constresponseB=awaitfetch('https://httpbin.org/post',{method: 'POST', body });console.log(awaitresponseB.json());})();
Why is this important? Fetch spec allows for passing URLSearchParams to indicate x-www-form-urlencoded payload. node-fetchfollows the spec. ohmyfetch does not, despite sending the user to node-fetch documentation for references.
Why it fails? Probably typeof (new URLSearchParams) === 'object'here
The text was updated successfully, but these errors were encountered:
Hi! The following requests fails to send
x-www-form-urlencoded
payload:Why is this important? Fetch spec allows for passing URLSearchParams to indicate
x-www-form-urlencoded
payload.node-fetch
follows the spec.ohmyfetch
does not, despite sending the user tonode-fetch
documentation for references.Why it fails? Probably
typeof (new URLSearchParams) === 'object'
hereThe text was updated successfully, but these errors were encountered: