Send Bytes Array. Error 414, Request URI Too Long

0

I'm trying to insert a byte array by API.

The call is made from a Web (Angularjs + PHP)

The API that receives it is developed in .NET

The problem with which I find myself is the following. We launch a GET request to a URL, along with a JSON as a parameter.

$urlInsercionDocumento = "1.1.1.1/Documento/InsertDatosDocumentoBytes/?Facturacion_ContratosDocumentosAPIDTO={'IdEmpresa':'1','IdUsuario':'1','ContratosDocumento':[{'IdCliente':'1','CodigoContrato':'1','Nombre':'Nombre','IdUsuarioCreador':'1','IsBloqueado':false,'IdDocumento':'','FileName':'NombreFichero','FileSize':'1111','FechaCreacion':'2018-01-01','FechaModificacion':'','Fichero':'Array de bytes codificado en base64'}]}";

This is the URL from which I launched the request.

The problem arises when I get a error 414, too long URI when hitting the server.

I understand that it is because it is not the correct procedure, to send this document, encoded as an array of bytes in base64.

I do not know if I should pass it in the body, or where. Any advice?

After changing it to POST, I see the following message:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML>
    <HEAD>
        <TITLE>Request URL Too Long</TITLE>
        <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
    </HEAD>
    <BODY>
        <h2>Request URL Too Long</h2>
        <hr>
        <p>HTTP Error 414. The request URL is too long.</p>
    </BODY>
</HTML>
    
asked by Diego 03.07.2018 в 14:10
source

0 answers