BitShares Forum

Main => Technical Support => Topic started by: kslavik on August 27, 2014, 06:42:15 pm

Title: .NET Rpc Example [RESOLVED]
Post by: kslavik on August 27, 2014, 06:42:15 pm
Does anybody has an example of the call to BitsharesX client using .NET

I used the following code:
Code: [Select]
using (WebClient pClient = new WebClient()) {
    string    strURL              = "http://user:pass@localhost:65066/rpc"
    string    strRequest       = "{\"method\": \"blockchain_get_block_count\", \"id\": 1 }" 
    return pClient.UploadString(strURL,strRequest);
}

throws the following exception:  "The server committed a protocol violation. Section=ResponseStatusLine"

I did try to use this one:
<httpWebRequest useUnsafeHeaderParsing="true" />
but it didn't help
Title: Re: .NET Rpc Example
Post by: xeroc on August 27, 2014, 07:18:36 pm
your request is wrong. Check out: https://bitsharestalk.org/index.php?topic=5562.msg75681#msg75681
Title: Re: .NET Rpc Example
Post by: kslavik on August 27, 2014, 08:58:13 pm
Problem solved - I was using rpc port instead of httpd_endpoint port