Request made with axios does not work but if it works with XMLHttpRequest

I’m doing a Request from react with axios, that request looks like this: const data= axios.post(route, { username:’admin’, password:’123′ }) .then(response =>{ console.log(response) }) .catch(err=>{console.log(err.response) }) But it gives me back status 400. I thought it was something with the ‘CORS’ but when I make the request with XMLHttpRequest from react, it is successful. Here the same request made with XMLHttpRequest: var xhr = new XMLHttpRequest(); var…

Details

mongodb move a string from one array to another

I need to make a request to move a string from one array to another. How can I do that ? JSON: https://jsoneditoronline.org/?id=442f1dae0b2d4997ac69d44614e55aa6 ………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………… { “_id”:”f58482b1-ae3a-4d8a-b53b-ede80fe1e225″, “bio”:{ “firstname”:”Лена”, “lastname”:”фыв”, “middlename”:””, “company”:”вв” }, “files”:[ { “_id”:”2e4e40c7-4df6-4974-8d16-bb24cd8134d6″, “destination”:”./uploads/f58482b1-ae3a-4d8a-b53b-ede80fe1e225″, “filename”:”2e4e40c7-4df6-4974-8d16-bb24cd8134d6.mp3″, “path”:”uploads\\f58482b1-ae3a-4d8a-b53b-ede80fe1e225\\2e4e40c7-4df6-4974-8d16-bb24cd8134d6.mp3″, “folder”:”f58482b1-ae3a-4d8a-b53b-ede80fe1e225″, “info”:{ “size”:20805727, “mimetype”:”audio/mp3″, “encoding”:”7bit”, “originalname”:”Ахуевший Ленусик (Банк русский стандарт). Выпуск #5..mp3″, “fieldname”:”selectedFile” }, “userId”:”5e05da745b21e61ccc84a892″, “date”:”2019-12-27T10:19:12.213Z”, “guessId”:{…

Details

PHP – How to solve message notification error “using $this when not in object context”?

Hello please am having a problem with my message sending notification in PHP PDO and below is my code for addMention sendNotification if someone mentions a user in his post. public function addMention($status,$user_id, $tweet_id){ preg_match_all(“/@+([a-zA-Z0-9_]+)/i”, $status, $matches); if($matches){ $result = array_values($matches[1]); } $sql = “SELECT * FROM users WHERE username = :mention”; foreach ($result as…

Details

co_await’ed coroutines don’t run concurrently in a console application

I don’t understand the output of my small code sample. When I debug inside the MS C++/WinRT code, I see a call to WINRT_TrySubmitThreadpoolCallback() and WINRT_CreateThreadpoolTimer(). I think 3 execution of g() should happen concurrently. This code: auto g() -> IAsyncAction { Log(L”Entering g()”); co_await winrt::resume_after(1s); Log(L”Exiting g()”); } auto f() -> IAsyncAction { Log(L”Entering…

Details