json.net

Trouble posting CREATERAWTRANSACTION to Bitcoin Core via JSON-RPC

梦想与她 提交于 2021-02-05 05:12:41
问题 I'm trying to post to a local bitcoin full node via json-rpc but I'm getting an error from the server. Following the documentation here: https://bitcoincore.org/en/doc/0.17.0/rpc/rawtransactions/createrawtransaction/ I can see the following example structure for a createrawtransaction request: {"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] } My code creates the following structure, which seems to

Trouble posting CREATERAWTRANSACTION to Bitcoin Core via JSON-RPC

自作多情 提交于 2021-02-05 05:08:50
问题 I'm trying to post to a local bitcoin full node via json-rpc but I'm getting an error from the server. Following the documentation here: https://bitcoincore.org/en/doc/0.17.0/rpc/rawtransactions/createrawtransaction/ I can see the following example structure for a createrawtransaction request: {"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] } My code creates the following structure, which seems to

Trouble posting CREATERAWTRANSACTION to Bitcoin Core via JSON-RPC

我只是一个虾纸丫 提交于 2021-02-05 05:06:50
问题 I'm trying to post to a local bitcoin full node via json-rpc but I'm getting an error from the server. Following the documentation here: https://bitcoincore.org/en/doc/0.17.0/rpc/rawtransactions/createrawtransaction/ I can see the following example structure for a createrawtransaction request: {"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] } My code creates the following structure, which seems to

How to mask sensitive values in JSON for logging purposes

三世轮回 提交于 2021-02-05 05:06:24
问题 I have several similar JSON structures that I want to write into a SQL table for logging purposes. However, some of the fields in the JSON contain sensitive information, which I want to partially mask so the full value is not visible in the log. Here is an example of one of the JSON structures: { "Vault": 1, "Transaction": { "gateway": { "Login": "Nick", "Password": "Password" }, "credit_card": { "number": "4111111111111" } } } In this case I'm trying to change the 4111 credit card number so

How to mask sensitive values in JSON for logging purposes

时光毁灭记忆、已成空白 提交于 2021-02-05 05:01:41
问题 I have several similar JSON structures that I want to write into a SQL table for logging purposes. However, some of the fields in the JSON contain sensitive information, which I want to partially mask so the full value is not visible in the log. Here is an example of one of the JSON structures: { "Vault": 1, "Transaction": { "gateway": { "Login": "Nick", "Password": "Password" }, "credit_card": { "number": "4111111111111" } } } In this case I'm trying to change the 4111 credit card number so

Understanding NewtonSoft in PowerShell

强颜欢笑 提交于 2021-02-04 19:45:45
问题 I making a foray into the world of JSON parsing and NewtonSoft and I'm confused, to say the least. Take the below PowerShell script: $json = @" { "Array1": [ "I am string 1 from array1", "I am string 2 from array1" ], "Array2": [ { "Array2Object1Str1": "Object in list, string 1", "Array2Object1Str2": "Object in list, string 2" } ] } "@ #The newtonSoft way $nsObj = [Newtonsoft.Json.JsonConvert]::DeserializeObject($json, [Newtonsoft.Json.Linq.JObject]) $nsObj.GetType().fullname #Type =

.net mvc view loop on javascript only updating first row in table

浪子不回头ぞ 提交于 2021-02-02 09:55:15
问题 I have 2 rows in my loop. I have 2 issues: The JavaScript appears to be executing on each iteration; however, it is only populating the first table row data with the result. I'm having to hard code the JSON object (for now) in the script, but ideally want to use a dynamic JSON string from my model data. Though whenever I try to reference it ( @item.requestExample ), the JavaScript fails and the inspect/console in the browser shows that it is referencing the string and finding invalid tokens.

json.net parsing mixed string and array

主宰稳场 提交于 2021-01-29 18:00:49
问题 I am trying to convert the below JSON property into an object. The string array is kind of a mixed type: its elements may be strings or string arrays. (Although the string arrays only show up in the occasional record.) I made the booster property a List<String> , which is fine, but the few rows that have the array at the end cause parsing to fail. Any ideas how I could handle this situation? "booster": [ "land", "marketing", "common", "common", "common", "common", "common", "common", "common"

Map JSON object to C# class property array

强颜欢笑 提交于 2021-01-29 18:00:30
问题 JSON { "SoftHoldIDs": 444, "AppliedUsages": [ { "SoftHoldID": 444, "UsageYearID": 223232, "DaysApplied": 0, "PointsApplied": 1 } ], "Guests": [ 1, 2 ] } In the above JSON SoftholdIDs is integer and AppliedUsages is class array property in C# Model Issue is --How we can map JSON to class property. Class code public class ReservationDraftRequestDto { public int SoftHoldIDs { get; set; } public int[] Guests { get; set; } public AppliedUsage[] AppliedUsages { get; set; } } public class

How can I deserialize a json object into a json string?

不问归期 提交于 2021-01-29 16:20:00
问题 I have the following json: { "name" : "tim", "items" : { "car" : "Mercedes", "house" : "2 Bedroom" } } The object to deserialize into is: public class Person { public string Name {get;set;} public string Items {get;set;} } I want to deserialize items into a string of the json object. So Items in this example should be "{\"car\" : \"Mercedes\",\"house\" : \"2 Bedroom\"}" I don't care about spacing such as tabs or new lines. How can I do this using Newtonsoft.Json ? I've tried making a