How to deal with the attribute with ‘-’ like “Cache-Control” in Java? ‘-’ can not be used when define an attribute, anybody knows how to do deserialization? Thanks.
Hey! Welcome to the Storyblok forum !
I have not worked with Java for some time now, but if I remember correctly you need to compile a JSONObject which is then converted to a string. A quick Google search brought up this article with the possible answer:
JSONObject jo = new JSONObject(); jo.put("Method", "POST"); jo.put("Request-URI", "http://www.example.com/"); jo.put("HTTP-Version", "HTTP/1.1"); String httpStr = HTTP.toString(jo);
Thanks, I have found a solution. just use @JsonProperty.