mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support http api json, to PUT/POST, to 0.9.103
This commit is contained in:
parent
b60e8418c6
commit
d6355efe22
11 changed files with 358 additions and 43 deletions
|
@ -343,7 +343,10 @@ SrsJsonAny* srs_json_parse_tree_nx_json(const nx_json* node)
|
|||
|
||||
SrsJsonAny* SrsJsonAny::loads(char* str)
|
||||
{
|
||||
srs_assert(str);
|
||||
if (!str) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strlen(str) == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -430,6 +433,21 @@ SrsJsonAny* SrsJsonObject::get_property(string name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SrsJsonAny* SrsJsonObject::ensure_property_string(string name)
|
||||
{
|
||||
SrsJsonAny* prop = get_property(name);
|
||||
|
||||
if (!prop) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!prop->is_string()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
||||
SrsJsonArray::SrsJsonArray()
|
||||
{
|
||||
marker = SRS_JSON_Array;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue