JSON::ParserError: 757: unexpected token at '{

前端 未结 4 1375
醉梦人生
醉梦人生 2021-01-05 00:43

the current hash is

{\\\"report_name\\\"=>\\\"Study/Control: ABIRATERONE ACETATE - 20151413355\\\", \\\"left_mue_start_date\\\"=>\\\"02-26-2015\\\",          


        
4条回答
  •  被撕碎了的回忆
    2021-01-05 01:16

    I ran into a similar problem, though it was failing while parsing \"\". This is in regards to using Pact.IO. I mention it here since this is the highest ranked Google result while looking for the error I encountered. The solution in my case was to change the body of a POST in my C# application so that it wasn't using empty string, but a null string. Basically I added this before my HTTP call.

    if (request.Method == HttpMethod.Post && request.Content!=null && request.Content.GetType()==typeof(StringContent) && request.Content.ReadAsStringAsync().Result == String.Empty)
      request.Content = new StringContent(null);
    

提交回复
热议问题