Hello,
Thanks for your help.
Now I get an error :
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The underlying connection has been closed : An unexpected error occurred on a send. ---> System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
à System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
à System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
à System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
à System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
à System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
à System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
à System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
à System.Net.TlsStream.CallProcessAuthentication(Object state)
à System.Threading.ExecutionContext.runTryCode(Object userData)
à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
à System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
à System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
à System.Net.ConnectStream.WriteHeaders(Boolean async)
--- Fin de la trace de la pile d'exception interne ---
à System.Net.HttpWebRequest.GetResponse()
--- Fin de la trace de la pile d'exception interne ---
à System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
à System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
à System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
à ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* , ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength, ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)
Could you help me please ? I get the error on this line : webRes = webReq.GetResponse();
I tried directly on the API portal of the partner, The correct URL is for example :
clrObj = System.Net.WebRequest::Create("https://api.dachser.com/rest/v2/shipmenthistory?tracking-number=4572418880307200&customer-id=8305600968523776");
And headers :
headers.Add("Accept-Language", "application/json");
headers.Add("X-IBM-Client-Id", "ce4fcc672e2f154342e318e1fa674c78");
headers.Add("accept", "application/json");
Thank you very much.