Fix Coding Problem for app (xamarin)

I am trying to make an API call from xamarin, this is my first Full mobile app calling restful API (.NetCore3.1) with a Angular WebApp. All other API calls from the xamarin app are working, The issue is I need to send a File with an object, file can be .doc .png etc.

[login to view URL] API Endpoint

public class FileProvider { public string GA { get; set; } public IList<IFormFile> Files { get; set; } } [HttpPost] [Route("[action]")] public ActionResult SubmitGrantApplication([FromForm] FileProvider fileProvider) { try { var ga = fileProvider; byte[] fileContent = null; var files = [login to view URL]() ? [login to view URL] : new FormFileCollection(); var grant = [login to view URL]<GrantApplication>([login to view URL]); ... } }

[login to view URL] Call made from the mobile app: This call is returning a 400 response with no clear indication why. I am trying to figure out why, And my postman skills aren't that great to convert the code to postman.

The error returned at #5.

::"Object reference not set to an instance of an object."

public class GrantService { public static async Task<GrantApplication> SubmitGrant(GrantApplication ga,string file, string FileName, StreamContent FileData) { Uri requestUri = new Uri($"{[login to view URL]}/grantapplication/SubmitGrantApplication"); try { var upfilebytes = [login to view URL](file); //using (HttpClient client = new HttpClient()) //{ // //MultipartFormDataContent content = new MultipartFormDataContent(); // //ByteArrayContent baContent = new ByteArrayContent(upfilebytes); // //StringContent GA = new StringContent([login to view URL](ga)); // //[login to view URL](baContent, "Files", FileName); // //[login to view URL](GA, "GA"); // //[login to view URL](content); // //var response = await [login to view URL](requestUri, content); // //[login to view URL](await [login to view URL]()); // //return ga; //} using (var formContent = new MultipartFormDataContent()) { [login to view URL] = "multipart/form-data"; // 3. Add the filename C:\\... + fileName is the path your file Stream fileStream = [login to view URL](file); [login to view URL](new StreamContent(fileStream), FileName, FileName); var payload = [login to view URL](ga); HttpContent content = new StringContent(payload, [login to view URL], "application/json"); [login to view URL](content, "GA"); using (var client = new HttpClient()) { // Bearer Token header if needed [login to view URL](new MediaTypeWithQualityHeaderValue("multipart/form-data")); try { // 4.. Execute the MultipartPostMethod var message = await [login to view URL](requestUri, formContent); // 5.a Receive the response var result = await [login to view URL](); [login to view URL](result); } catch (Exception ex) { // Do what you want if it fails. throw ex; } } } return ga; } catch(Exception ex) { [login to view URL](ex); return ga; } } }

Web System Angular API call

public SubmitGrantApplication(grantApplication){ [login to view URL] = [login to view URL]([login to view URL]("LoggedInUser")).memberID; [login to view URL] = [login to view URL]([login to view URL]("LoggedInUser")).clientID; [login to view URL] = new HttpHeaders({ 'Content-Type' : 'multipart/form-data' }); [login to view URL] = new HttpHeaders({ 'Accept': 'multipart/form-data'}); let myFormData: FormData = new FormData(); [login to view URL]("Files", [login to view URL]); [login to view URL]("GA", [login to view URL](grantApplication)); return [login to view URL]<GrantApplication>(this.url+"SubmitGrantApplication", myFormData , { headers: [login to view URL] }).pipe( ).toPromise(); }


Swagger Doc

Works Angular API Call Works Payload Angular

Compétences : AngularJS, PhoneGap, Structure Ionique, Mobile App Development, JavaScript

En voir plus : fix pagination problem, fix apache problem linux, fix ie7 problem home page, fix card problem paypal, fix wimpy problem flash upgrade, fix ffmpeg problem, fix css problem explorer, png fix loading problem, fix dns problem 2003, oscommerce fix logout problem, simple php fix apostrophe problem, fix 1054 problem, fix plug problem web site uses java script, fix template problem, how to make a calling app in android, how to make video calling app in android studio, how to make a calling app in android studio, how to make full screen whatsapp status app

Concernant l'employeur :
( 0 commentaires ) Perth, Australia

Nº du projet : #30612403

5 freelances font une offre moyenne de 204 $ pour ce travail

(10 Commentaires)

Hello Dear. I read your job description carefully. I can do your project. As for me, JavaScript is a piece of cake. I have a lot of experience in JavaScript Framework like Vue.js , Angular.js , React.js and etc. Specia Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 3 jours
(10 Commentaires)

Hello. I reviewed your request carefully. I can complete your task. I have 10 years of c# development experience. I am familiar with php、wordpress. SQL、asp.net、mvc、.net core、 html、 css、React、vue、angular、 jquery、 Jav Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 7 jours
(1 Évaluation)

Hello, I am 7+ Experienced Full Stack Engineer with Certified Xamarin Developer having following Skill Sets. Benefits of My Programming will be, 1. Code will be developed using the Standards that MNC company follows. Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 2 jours
(1 Évaluation)

Hi, I hope you are doing well! I came across your project details and wanted to get in touch with you regarding your project that you are looking for experienced Xamarin developer with good knowledge of c# and .net f Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 5 jours
(0 Commentaires)