Completed

Fazer uma Api cliente para receber dados

Published on the December 06, 2017 in IT & Programming

About this project

Open

Tenho a necessidade de fazer um cliente para receber dados de um outro sistema.
1 – A API cliente consulta o endereço e receber um token
2 – A api consulta o pedido passando o número e token, recebe os dados do pedido, cliente, cabeçalho do pedido e itens do pedido e grava no banco, fazendo as validações necessárias como a validação do cliente existente

1 – Fazer uma API que vai retornar algumas informações da unidade que faz o atendimento,

Exemplo do que preciso para o cliente:

public string ConsultarUsuario(string url)
{

    var request = (HttpWebRequest)WebRequest.Create(url);
    var postData = "{ username:sistema, password:senha }";
    var data = Encoding.ASCII.GetBytes(postData);

    request.Method = "POST";
    request.ContentType = "raw";
    //  request.ContentType = "application/json";
    // request.ContentType = "application/x-www-form-urlencoded";
    request.ContentLength = data.Length;

    using (var stream = request.GetRequestStream())
    {
          stream.Write(data, 0, data.Length);
    }
    var response = (HttpWebResponse)request.GetResponse();
    var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
            return responseString;
}

Category IT & Programming
Subcategory Web development
What is the scope of the project? Medium-sized change
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
API Integrations Other (Other APIs)
Roles needed Developer

Delivery term: Not specified

Skills needed

Other projects posted by C.