Multipart HTTP response

You can serve the response as multipart/form-data and use Response.formData() to read response at client fetch(“/path/to/server”, {method:”POST”, body:formData}) .then(response => response.formData()) .then(fd => { for (let [key, prop] of fd) { console.log(key, prop) } }) let fd = new FormData(); fd.append(“json”, JSON.stringify({ file: “image” })); fetch(“data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQACgABACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkEAAoAAgAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkEAAoAAwAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkEAAoABAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQACgAFACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQACgAGACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAAKAAcALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==”) .then(response => response.blob()) .then(blob => { fd.append(“file”, blob); new … Read more

Why do whatsapp web application needs phone connection all the time?

The official explanation: Your session on WhatsApp Web is an extension of WhatsApp on your phone. WhatsApp Web connects to your phone to sync messages, thus you can see all messages on both devices. Thus, the first requirement to being able to use WhatsApp Web is an active WhatsApp account on your smartphone. Source: https://www.whatsapp.com/faq/en/web/28080002 … Read more

json-server cannot access via local IP

I found the solution for this issue: json-server –host 192.168.1.XXX my_file.json Using this command, server is deployed on my local IP, and Windows asks for a firewall exception. Another solution is to switch to .NET server – another free simple fake server where I can setup local IP as endpoint. All it needs to: install … Read more