JsonValue Type
Represents a JSON value. Large numbers that do not fit in the Decimal type are represented using the Float case, while smaller numbers are represented as decimals to avoid precision loss.
Union cases
| Union case |
Description
|
|
A JSON array of values
|
Full Usage:
Boolean bool
Parameters:
bool
|
A JSON boolean value
|
Full Usage:
Float float
Parameters:
float
|
A JSON number stored as a float (used for large numbers that do not fit in decimal)
|
Full Usage:
Null
|
A JSON null value |
Full Usage:
Number decimal
Parameters:
decimal
|
A JSON number stored as a decimal (used for numbers that fit in the decimal range)
|
|
A JSON object, represented as an array of name-value pairs
|
Full Usage:
String string
Parameters:
string
|
A JSON string value
|
Instance members
| Instance member |
Description
|
Full Usage:
this.IsArray
Returns: bool
|
|
Full Usage:
this.IsBoolean
Returns: bool
|
|
Full Usage:
this.IsFloat
Returns: bool
|
|
Full Usage:
this.IsNull
Returns: bool
|
|
Full Usage:
this.IsNumber
Returns: bool
|
|
Full Usage:
this.IsRecord
Returns: bool
|
|
Full Usage:
this.IsString
Returns: bool
|
|
Full Usage:
this.Request
Parameters:
string
-
The URL to send the JSON to.
?httpMethod : string
-
The HTTP method to use (default: POST).
?headers : (string * string) seq
-
Additional HTTP headers to include.
Returns: HttpResponse
An HttpResponse containing the server's response.
|
Sends the JSON to the specified URL synchronously. Defaults to a POST request.
|
Full Usage:
this.RequestAsync
Parameters:
string
-
The URL to send the JSON to.
?httpMethod : string
-
The HTTP method to use (default: POST).
?headers : (string * string) seq
-
Additional HTTP headers to include.
Returns: Async<HttpResponse>
An async computation yielding an HttpResponse containing the server's response.
|
Sends the JSON to the specified URL asynchronously. Defaults to a POST request.
|
Full Usage:
this.ToString
Parameters:
int
-
Number of spaces per indentation level (default 2).
Returns: string
The formatted JSON string representation.
|
Serializes this JsonValue to a formatted (indented) string.
|
Full Usage:
this.ToString
Parameters:
JsonSaveOptions
-
Controls formatting: indented, compact, or compact with spaces.
?indentationSpaces : int
-
Number of spaces per indentation level (default 2). Only used when saveOptions is JsonSaveOptions.None.
Returns: string
The JSON string representation.
|
Serializes this JsonValue to a string with the specified formatting options.
|
Full Usage:
this.WriteTo
Parameters:
TextWriter
-
The writer to serialize to.
saveOptions : JsonSaveOptions
-
Controls formatting: indented, compact, or compact with spaces.
?indentationSpaces : int
-
Number of spaces per indentation level (default 2). Only used when saveOptions is JsonSaveOptions.None.
|
Serializes the JsonValue to the specified System.IO.TextWriter.
|
Static members
| Static member |
Description
|
|
|
|
|
Full Usage:
JsonValue.Load(reader)
Parameters:
TextReader
-
The text reader to read JSON from.
Returns: JsonValue
A JsonValue representing the parsed JSON.
|
Loads JSON from the specified reader.
|
|
|
|
|
|
|
|
FSharp.Data