Skip to content
Discussion options

You must be logged in to vote

It depends... I think if you submit a form then it uses, multipart/form-data,, for example:

import { foo } from './actions'

export default function Home() {
  return (
  <form action={foo}>
      <button type="submit">go</button>
    </form>
  );
}

Has these headers:

But this:

'use client'
import {foo} from './actions'

export default function Home() {
  return (
      <button  onClick={() => foo()}>go</button>
  );
}

Has the headers you report:

I think those are the cases. We'd need to loop in React here, since Server Actions are a React feature...

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@icyJoseph
Comment options

@anton-johansson
Comment options

@revoltez
Comment options

Answer selected by anton-johansson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants