Sending POST axios request with Array of objects

自闭症网瘾萝莉.ら 提交于 2019-12-02 16:06:24

问题


I am trying to send a POST request with an array of objects using axios. But I am having 500 internal server error and no exceptions on the server. When I send a single object it works fine but not with an array of objects, in this case, it not even trigger my REST service. Does someone have any idea? My array of objects looks like this:-

arrayofObjects:[
    {},
    {},
    several objects here   
]

POST request:-

axios.post(URL,JSON.stringify(this.arrayofObjects), headers)
.then(response=>{
    returnData = (response.data);
 })
.catch(ext=>{
   alert(ext.response.data);  
 })

Here is the REST Service(not the complete code):-

@POST
@Path("/uvw")
@consumes(MediaType.APPLICATIOM_JSON)
public Response uVW(List<objectData> requested){
   // remaining code
    try{
     return Response.ok().build();
     }catch(){
    return
    }  
}

来源:https://stackoverflow.com/questions/49323401/sending-post-axios-request-with-array-of-objects

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!