问题是与此one有什么关系,但我在那儿找不到答案。
领先的提交功能:
export async function submitLeads(fdata) {
let url = baseUrl+"/submit";
let headers = new Headers();
headers.append("Content-Type", "multipart/form-data")
const response = await fetch(url, {
method: "POST",
body: fdata,
header: headers
});
if (response.ok) {
return response.json()
} else {
console.log("There seems to be some error in fetching data" + response.statusText);
}
}
PHP Lead提交功能:
public function processLeads(Request $request)
{
$a_formSubmit = $request->request->all();
$response = json_decode($this->curlPost(LEAD_END_POINT, $a_formSubmit), true);
//echo json_encode($a_formSubmit);//still fine I am getting my input
//exit;
if ($isValidResult = isset($response['status']) && $response['status'] == 101) {
//echo json_encode($response);//Here no I am getting a empty $response['data']; why??
//exit;
$this->setSubmittedSchools($session, $response['data']);
LeadResponseLogger::logLeadResponse($a_formSubmit, $response['data']);
echo json_encode($response['data']);
}
}
卷曲帖子功能:
let formData = this.leadSubmitFields(this.state, this.props.appState);
submitLeads(formData).then((lead) => {
console.log(lead);
});