Spring MVC: Doesn't deserialize JSON request body

前端 未结 6 1418
忘掉有多难
忘掉有多难 2020-12-02 09:28

I\'m working on a Spring MVC project and one of the tasks I need to do requires me to have a string of JSON data sent through by the user in a POST request. I know that Spri

6条回答
  •  無奈伤痛
    2020-12-02 09:57

    if your Content-type is "application/json" and your first messageConvertor is not org.springframework.http.converter.StringHttpMessageConverter , Spring could not work right. In my case , I did this:

    
    		
    			
    			
    		
    	
    
    
    	
    	
    		
    			
    				
    					
    					
    					
    				
    				
    					
    					
    					
    				
    			
    		
    	
    
    	
    		
    			
    				
    					
    					
    					
    				
    				
    					
    					
    					
    				
    			
    		
    		
    		
    			
    				
    					
    						
    					
    				
    			
    		
    	

提交回复
热议问题