Serialize serializes the Request to JSON string.
()
| 124 | |
| 125 | // Serialize serializes the Request to JSON string. |
| 126 | func (r *Request) Serialize() result.Result[string] { |
| 127 | for k, v := range r.Temp { |
| 128 | r.Temp.set(k, v) |
| 129 | r.TempIsJSON[k] = true |
| 130 | } |
| 131 | b, err := json.Marshal(r) |
| 132 | if err != nil { |
| 133 | return result.TryErr[string](err) |
| 134 | } |
| 135 | return result.Ok(strings.ReplaceAll(util.Bytes2String(b), `\u0026`, `&`)) |
| 136 | } |
| 137 | |
| 138 | // Unique returns the unique identifier for the request. |
| 139 | func (r *Request) Unique() string { |