• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

make https call from acrobat plugin

New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

Hi,

 

I am getting the below error while making a https request from my Acrobat plugin, also below is the code that is used to make the api call

 

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.ComponentModel.Win32Exception: No credentials are available in the security package

 

using (var httpClient = new HttpClient(handler))
{
try
{
using var fileStream = File.OpenRead(filePath);
using var requestMessage = new HttpRequestMessage(HttpMethod.Post, uri);
using var content = new MultipartFormDataContent
{
{ new StreamContent(fileStream), "file", "test.pdf" }
};
requestMessage.Content = content;
using var response = await httpClient.SendAsync(requestMessage);
MessageBox.Show(response.StatusCode.ToString());
//response.EnsureSuccessStatusCode();
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
//throw;
}
}

 

 

TOPICS
Windows

Views

52

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

LATEST

What exactly do you mean by "plug-in"? 

What language are you writing in? and on what platform?

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines