POST http://localhost:5001/api/v1/identity/login 500 (Internal Server Error) LoginForm.jsx:39 Error: Request failed with status code 500 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.handleLoad (xhr.js:61)
C#
import React from 'react';
import axios, { post } from 'axios';
import CONST from '../CONST';
class Upload extends React.Component {
constructor(props) {
super(props);
this.state = {
file: null,
};
this.onFormSubmit = this.onFormSubmit.bind(this);
this.onChange = this.onChange.bind(this);
this.fileUpload = this.fileUpload.bind(this);
}
onFormSubmit(e) {
e.preventDefault();
this.fileUpload(this.state.file);
}
onChange(e) {
this.setState({ file: e.target.files[0] });
}
fileUpload(file) {
let data = new FormData();
data.append('data', file);
axios
.post(`https://api.graph.cool/file/v1/${CONST.projectID}`, data, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
.then(response => {
console.log('file upload response', response);
});
}
render() {
return (
<form onSubmit={this.onFormSubmit}>
<h1>File Upload</h1>
<input type="file" onChange={this.onChange} />
<button type="submit">Upload</button>
</form>
);
}
}
export default Upload; axios.post(
config.apiGateway.URL + ".../signin",
payload
).then(response => {
console.log(response)
if(response.status == 200){
console.log("Login successfull");
this.setState({token: response.data.JWT_TOKEN});
} else {
console.log(response.status)
this.setError()
}
}).catch(error => {
this.setError()
console.log(error)
if (error.response) {
console.log("--------------------------------------------------")
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
console.log("*************************")
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
} else {
console.log("++++++++++++++++++++++++")
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
}
console.log(error.config);
})
Also in C#:
- Title
- List C# add from List
- Category
- C#
- Title
- value is null to insert in c#
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- get random point within radius
- Category
- C#
- Title
- dynamic convert type c#
- Category
- C#
- Title
- c# read excel file
- Category
- C#
- Title
- what is a protected int c#
- Category
- C#
- Title
- how to pause physics in unity c#
- Category
- C#
- Title
- functions unity
- Category
- C#
- Title
- c# webcam
- Category
- C#
- Title
- c# keyvaluepair
- Category
- C#
- Title
- take screenshot in c#
- Category
- C#
- Title
- c# convert Unix time in seconds to datetime
- Category
- C#
- Title
- c# null conditional
- Category
- C#
- Title
- unity detect any key
- Category
- C#
- Title
- c# window instantly close
- Category
- C#
- Title
- c# get list of all class fields
- Category
- C#
- Title
- nunit return parameter
- Category
- C#
- Title
- eager loading c#
- Category
- C#
- Title
- find month number from date C#
- Category
- C#
- Title
- linq in c#
- Category
- C#
- Title
- c# remove character from string at index
- Category
- C#
- Title
- exit game unity
- Category
- C#
- Title
- get all child gameObject of gameObject C#
- Category
- C#
- Title
- how to make a for loop in c#
- Category
- C#
- Title
- loop gridcontrol devexpress c#
- Category
- C#
- Title
- C# get object property name
- Category
- C#
- Title
- c# create a text file
- Category
- C#
- Title
- if and c#
- Category
- C#
- Title
- iformfile blobclient
- Category
- C#
- Title
- asp.net list all files in folder
- Category
- C#
- Title
- c# convert list to string
- Category
- C#
- Title
- c# regex replace
- Category
- C#
- Title
- make string
- Category
- C#
- Title
- percentage in c#
- Category
- C#
- Title
- c# convert double to int
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#
- Title
- c# switch statement
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- linq c# where condition
- Category
- C#
- Title
- how to stop player rotating when hit by object
- Category
- C#
- Title
- c# properties
- Category
- C#
- Title
- debug.log unity
- Category
- C#
- Title
- how to add array to list in c#
- Category
- C#
- Title
- c# how to exit program
- Category
- C#
- Title
- unity fall damage c#
- Category
- C#
- Title
- c# read file stream
- Category
- C#
- Title
- Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds
- Category
- C#
- Title
- get first and last item list c#
- Category
- C#
- Title
- find mongodb c# with task T
- Category
- C#
- Title
- random from list c#
- Category
- C#
- Title
- asp net mvc 5 return view from another controller
- Category
- C#
- Title
- unity 2d top down movement
- Category
- C#
- Title
- xamarin forms alarm
- Category
- C#
- Title
- how to hide a panel ui unity
- Category
- C#
- Title
- c# check file exists
- Category
- C#
- Title
- c# unhandled exception in thread
- Category
- C#
- Title
- abstract class c#
- Category
- C#
- Title
- Add component object to gameobject unity
- Category
- C#
- Title
- c# substring from index to end
- Category
- C#
- Title
- c# check if argument null
- Category
- C#
- Title
- c# string contains space
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- remove all array elements c#
- Category
- C#
- Title
- dynamic in c#
- Category
- C#
- Title
- c# remove last character from string
- Category
- C#
- Title
- Check object is in layermask unity
- Category
- C#
- Title
- unity list length
- Category
- C#
- Title
- .net core copy file in folder to root
- Category
- C#
- Title
- unity c# public all codes
- Category
- C#
- Title
- unix time c#
- Category
- C#
- Title
- c# get foreground window
- Category
- C#
- Title
- C# webclient immitate browser
- Category
- C#
- Title
- c# null conditional operator if statement
- Category
- C#
- Title
- clear combobox c#
- Category
- C#
- Title
- how to add a gameobject
- Category
- C#
- Title
- list c#
- Category
- C#
- Title
- c# list.foreach
- Category
- C#
- Title
- C# downloadstirng download old
- Category
- C#
- Title
- how to populate listbox using list<t> c#
- Category
- C#
- Title
- loops in coding
- Category
- C#
- Title
- .net core download image from url binary file
- Category
- C#
- Title
- c# get date without time
- Category
- C#
- Title
- c# get current date
- Category
- C#
- Title
- how to set a gizmo color unity
- Category
- C#
- Title
- c# dynamic object get value
- Category
- C#
- Title
- unity simple fps controller
- Category
- C#
- Title
- how consider the first caracter in Split c#
- Category
- C#
- Title
- using mediamanager how to play mp3 files
- Category
- C#
- Title
- c# unity rotate first person controller script
- Category
- C#
- Title
- what is using static in c#
- Category
- C#
- Title
- c# generic abstract method
- Category
- C#
- Title
- unity collider2d contains point
- Category
- C#
- Title
- unity 2d enemy field of view
- Category
- C#
- Title
- c# expression func automatically select return type
- Category
- C#
- Title
- formula calculating distance coordinates latitude longitude c#
- Category
- C#
- Title
- c# arraylist contains
- Category
- C#
- Title
- windows form rounded corners
- Category
- C#
- Title
- c# index in select
- Category
- C#