Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking with API #785

Closed
re1995 opened this issue Jul 25, 2018 · 2 comments
Closed

checking with API #785

re1995 opened this issue Jul 25, 2018 · 2 comments

Comments

@re1995
Copy link

re1995 commented Jul 25, 2018

I'm a beginner programmer...I don't know how to checkin with the second way of this page:
https://github.com/opensourceBIM/BIMserver/wiki/Checkin
I use c# for programming and this is a sample of my code for login:
`

private void button1_Click(object sender, EventArgs e)
{
var baseAddress = "http://IPAddress/json";
var requ = @"{""request"":{""interface"":""AuthInterface"",""method"":""login"",""parameters"":{""username"":""(((username)))"",""password"":""(((password)))""}}}";
var http = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress));
http.Accept = "application/json";
http.ContentType = "application/json";
http.Method = "POST";

    string parsedContent = requ.Replace("(((username)))", textBox3.Text).Replace("(((password)))", textBox4.Text);
    ASCIIEncoding encoding = new ASCIIEncoding();
    Byte[] bytes = encoding.GetBytes(parsedContent);

    Stream newStream = http.GetRequestStream();
    newStream.Write(bytes, 0, bytes.Length);
    newStream.Close();

    var response = http.GetResponse();

    var stream = response.GetResponseStream();
    var sr = new StreamReader(stream);
    var content = sr.ReadToEnd();
    textBox2.Text = content;
    int responselength = content.Length;
    string response1 = content.Substring(23, responselength - 26);
    textBox7.Text = response1;
        }

`
please send a sample code like this for checkin!

@rubendel
Copy link
Member

Try reformatting your issue so it's readable, this will increase the changes of somebody responding to it. So far I haven't seen any C# developers on this issue tracker though...

@rubendel
Copy link
Member

Closing for now, I don't think there are any C# devs reading this tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants