Derk-Jan Karrenbeld
07/24/2019, 11:47 PMDerk-Jan Karrenbeld
07/24/2019, 11:47 PMDerk-Jan Karrenbeld
07/24/2019, 11:47 PMkittinunf
07/30/2019, 7:09 AMkittinunf
07/30/2019, 7:09 AMkittinunf
07/30/2019, 7:10 AMDerk-Jan Karrenbeld
07/30/2019, 12:29 PMNikky
07/30/2019, 12:31 PMDerk-Jan Karrenbeld
07/30/2019, 12:35 PMDerk-Jan Karrenbeld
07/30/2019, 12:35 PMDerk-Jan Karrenbeld
07/30/2019, 12:36 PMDerk-Jan Karrenbeld
07/30/2019, 12:37 PMDerk-Jan Karrenbeld
07/30/2019, 12:37 PM* A Repeatable Body wraps a body and on the first [writeTo] it keeps the bytes in memory so it can be written again.
Derk-Jan Karrenbeld
07/30/2019, 12:38 PMBodies are formed from generic streams, but there are helpers to set it from values that can be turned into streams. It is important to know that, by default, the streams are NOT read into memory until the Request is sent. However, if you pass in an in-memory value such as a ByteArray or String, Fuel uses RepeatableBody, which are kept into memory until the Request is dereferenced.
Derk-Jan Karrenbeld
07/30/2019, 12:38 PMasRepeatable
helper method!Derk-Jan Karrenbeld
07/30/2019, 12:41 PMtoByteArray
you can see how I did this on DefaultBody
Derk-Jan Karrenbeld
07/30/2019, 12:43 PMcurlString
uses toByteArray
, so this should work...Nikky
07/30/2019, 1:13 PMNikky
07/30/2019, 1:18 PMNikky
07/30/2019, 1:18 PMNikky
07/30/2019, 1:28 PMNikky
07/30/2019, 1:28 PMDerk-Jan Karrenbeld
07/30/2019, 1:28 PMwell nevermind, seems liek the .asRepeatable is only on one BOdy type, it should be on Body i think and in RepeatableBody it is just returning itselfah. my bad. yes, should be everywhere I think
Derk-Jan Karrenbeld
07/30/2019, 1:29 PM@Derk-Jan Karrenbeld mind if i push to your branch ?Do your thing!!!
Derk-Jan Karrenbeld
07/30/2019, 1:29 PMi do pass in the jsonBody as string though...Doesn't matter. We convert everything to a stream 🙂
Nikky
07/30/2019, 1:31 PMHowever, if you pass in an in-memory value such as a ByteArray or String, Fuel uses RepeatableBody, ...
Nikky
07/30/2019, 1:32 PMDerk-Jan Karrenbeld
07/30/2019, 3:26 PMHowever, if you pass in an in-memory value such as a ByteArray or String, Fuel uses RepeatableBody, ...Let me check