How to connect frontend (react) to backend (fastapi) using POST
I have this frontend (react js ) code right here and I just want that the text entered in the textarea goes into the backend (fastapi) after clicking the button. I don't understand how to write the backend(fast API ) code.
import React from "react";
import { ArrowBigRight, Mic } from "lucide-react";
const InputBox = () => {
async function SendMessage() {
const Prompt = document.querySelector("textarea").value;
}
return (
);
};
export default InputBox;