aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Content-Type of headers will not be replaced by Content-Type of aiohttp.FormData() when Content-Type in headers

Open kingangelAOA opened this issue 6 years ago • 2 comments

Long story short

when headers: {"Content-Type":"multipart/form-data"} form_data = aiohttp.FormData() form_data.add_field('arguments', 'xxxx') form_data.add_field('_0', await file_test(), filename='xxxxx.jpg') Content-Type is multipart/form-data, not multipart/form-data; boundary=4f4048ddd61b4f97b6b6d2aef81584e2 because: for (key, value) in body.headers.items(): if key in self.headers: continue if key in self.skip_auto_headers: continue self.headers[key] = value aiohttp.client_reqrep.py 500~505

result: boundary not in Content-Type In general, content-type is added to headers, but not add boundary

Expected behaviour

can get boundary from aiohttp.FormData

Actual behaviour

did not get boundary

Steps to reproduce

Your environment

python versions: 3.6.1 aiohttp versions: 3.5.4

kingangelAOA avatar Jul 09 '19 13:07 kingangelAOA

<script>
  let show = false;
  let count = 0;

  function toggle() {
    show = !show;
    count += 1;

    // Use a reactive statement to force a re-evaluation of props
    $: {}

    // Simulate fading in
    setTimeout(() => {
      // Simulate fading out
      show = !show;
    }, 500);
  }
</script>

<button on:click={toggle}>Toggle</button>

{#if show}
  <div in:fade>
    <p>Prop passed count: {count}</p>
  </div>
{/if}

ljluestc avatar Nov 20 '23 05:11 ljluestc

It's hard to know what you're asking. This needs complete example code demonstrating the issue.

Dreamsorcerer avatar Aug 15 '24 23:08 Dreamsorcerer