/** * Set a Json Body to this request. * The <tt>Content-Type</tt> header of the request is set to <tt>application/json</tt>. * * @param json the JsValue * @return the modified builder */ public RequestBuilder bodyJson(JsValue json) { return bodyJson(Json.parse(play.api.libs.json.Json.stringify(json))); }
@Override public String body() { return jsonContent.toString(); }
@Test void deserializeShouldThrowWhenNoFlags() { assertThatThrownBy(() -> DTO_JSON_SERIALIZE.messageMetaDataReads().reads(Json.parse("{" + " \"uid\": 123456," + " \"modSeq\": 35," + " \"size\": 45, " + " \"internalDate\": \"2018-12-14T09:41:51.541Z\"," + " \"messageId\": \"42\"" + "}")) .get()) .isInstanceOf(NoSuchElementException.class); }
/** * Set a Json Body to this request. * The <tt>Content-Type</tt> header of the request is set to <tt>application/json</tt>. * * @param json the JsValue * @return the modified builder */ public RequestBuilder bodyJson(JsValue json) { return bodyJson(Json.parse(play.api.libs.json.Json.stringify(json))); }
/** * Set a Json Body to this request. * The <tt>Content-Type</tt> header of the request is set to <tt>application/json</tt>. * * @param json the JsValue * @return the modified builder */ public RequestBuilder bodyJson(JsValue json) { return bodyJson(Json.parse(play.api.libs.json.Json.stringify(json))); }