skip to Main Content

javascript: Not sending array with fetch api

I am trying to send array with fetch api. but it goes null. javascript: const url = "/TMF/DownloadFolderFilesAsZip"; var data = { method: "POST", body: JSON.stringify({ folderFiles: foldersFiles }), headers: new Headers({ 'content-type': 'application/json' }) } fetch(url, data) .then(resp =>…

VIEW QUESTION

Deployment of ASP.NET Core Web API to PLESK

This is my web.config file (ASP.NET Core 7.0) : <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".Test.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" /> <defaultDocument> <files> <clear /> <add value="index.html" /> </files> </defaultDocument> </system.webServer> </configuration> In this case…

VIEW QUESTION

How to post selected checkboxes as an array from angular to api – Html

I've created a component "form-page" in the "form" module: form-page.component.html: <form [formGroup]="form" (submit)="onSubmit()"> <div> <label for="carmodel">Car Model:</label> <input type="text" class="form-control" formControlName="carmodel"> <div *ngIf="form.controls['carmodel'].touched && form.controls['carmodel'].errors"> <div *ngIf="form.controls['carmodel'].hasError('required')" class="error">Carmodel is required.</div> <div *ngIf="form.controls['carmodel'].hasError('minlength')">Carmodel should be minimum 3 characters.</div> </div> </div> <div>…

VIEW QUESTION

Unable to POST an array of Selected Checkboxes using Fetch – Html

html form: <form name="CarServ" id="myForm"> <div> <label>CarModel:</label> <input type="text" id="model" size="65" name="CarModel" placeholder="Enter Car Model" required> </div> <div> <label>Car Number:</label> <input type="text" size="65" id="num" name="CarNumber" placeholder="Enter Car Number" required > </div> <div> <label>Contact number:</label> <input type="text" size="65" id="cnum" name="ContactNumber" placeholder="Enter…

VIEW QUESTION

Visual Studio Code – POST and GET values from 3 Tables linked through many to many relationship with Code First

Html form in Visual Studio Code with multi selectable checkboxes : <form name="CarServ" id="myForm"> <div> <label>CarModel:</label> <input type="text" id="model" size="65" name="CarModel" placeholder="Enter Car Model" required> </div> <div class="check"> <label>Addons:</label> <input type="checkbox" name ="SelectedCheckboxes[]" value="10%off First service visit" id="10%off First service…

VIEW QUESTION

How to get ObjectId instead of Timestamp and other information in a List field when querying MongoDB with ASP.NET Core Web API?

My mongodb user collection is of following schema: { _id: ObjectId("6420eb68cd0df40a33b0ead7"), FirstName: 'Ashutosh', LastName: 'Garg', Email: '[email protected]', Password: 'password', Role: 'Tenant', Properties: [ ObjectId("6420eeb8cd0df40a33b0eadb") ] } My User.cs is: using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; using System.Text.Json.Serialization; namespace webapi.Models {…

VIEW QUESTION
Back To Top
Search