undefinedfix
Sign in

When using Axios to send data, the back end can't accept it. What should I do

Marius edited in Wed, 22 Jun 2022

clipboard.png

clipboard.png

I always want to talk about JSON data. Axios will pass it by default. It's not good to use QS. Does anyone know what to do

11 Replies
Charlypop
commented on Wed, 22 Jun 2022

According to the problems encountered in several interactions with front-end and back-end and others, a conclusion is drawn that the back-end developer's JSON refers to the JSON string, while the front-end developer's JSON is generally object, which is embarrassing

Todd
commented on Wed, 22 Jun 2022

Provide the request header and request body screenshot of the network related request of browser F12, if the request is correct. (network reasons, pictures failed to load in time, sorry did not see) that is the problem of the background, in addition, you do not tell what the background is written, others can not help. Different languages have different ways of receiving and processing JSON.

josecanalla
commented on Wed, 22 Jun 2022

What is the HTTP error code

linkw88wap
commented on Wed, 22 Jun 2022

This kind of question lets the back end look at the log , The front end has no problem with the request from the screenshot

aleonjhon
commented on Wed, 22 Jun 2022

Is the interface annotated @ requestparam

lukaszkups
commented on Thu, 23 Jun 2022

For example, if an interface error occurs, first use postman to determine whether it is a background problem. If it is, go to the background instead of checking your own code

Tohiko
commented on Thu, 23 Jun 2022

Axios default type is JSON

TechGPrimeZ
commented on Thu, 23 Jun 2022

It should be the problem of processing mechanism. I also encountered this problem when I was developing a project some time ago. The java interface can't receive the JSON passed by Axios, but the go interface can. After changing to Ajax, both Java and go can work. This is the problem of the back end

SendETHToThisAddress
commented on Fri, 24 Jun 2022

Is the interface annotated?

eMMMM
commented on Fri, 24 Jun 2022

Try converting it to a string

SomeGuy
commented on Fri, 24 Jun 2022

Axios parameter

lock This question has been locked and the reply function has been disabled.