Skip to content

Commit a5c254c

Browse files
author
infobip-ci
committed
Update to version 3.0.1
1 parent c4361b8 commit a5c254c

File tree

7 files changed

+153
-147
lines changed

7 files changed

+153
-147
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to the library will be documented in this file.
55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.
77

8+
## [ [3.0.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v3.0.1) ] - 2024-08-28
9+
10+
### Fixed
11+
- Cannot have multiple recipient in a single email (https://github.com/infobip/infobip-api-csharp-client/issues/18)
12+
- Multiple attachments support (https://github.com/infobip/infobip-api-csharp-client/issues/24)
13+
- Zip Email attachment - not working (https://github.com/infobip/infobip-api-csharp-client/issues/34)
14+
815
## [ [3.0.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v3.0.0) ] - 2024-07-31
916

1017
🎉 **NEW Major Version of `Infobip.Api.Client`.**

src/Infobip.Api.Client/Api/EmailApi.cs

Lines changed: 124 additions & 122 deletions
Large diffs are not rendered by default.

src/Infobip.Api.Client/Client/ApiClient.cs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -442,19 +442,19 @@ private HttpContent PrepareMultipartFormDataContent(RequestOptions options)
442442
var boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant();
443443
var multipartContent = new MultipartFormDataContent(boundary);
444444
foreach (var formParameter in options.FormParameters)
445-
multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key);
445+
foreach (var parameterValue in formParameter.Value)
446+
multipartContent.Add(new StringContent(parameterValue), formParameter.Key);
446447

447448
if (options.FileParameters != null && options.FileParameters.Count > 0)
448-
foreach (var fileParam in options.FileParameters)
449-
{
450-
var fileStreamName = fileParam.Value is FileStream fileStream
451-
? Path.GetFileName(fileStream.Name)
452-
: null;
453-
var content = new StreamContent(fileParam.Value);
454-
content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
455-
multipartContent.Add(content, fileParam.Key,
456-
fileStreamName ?? "no_file_name_provided");
457-
}
449+
foreach (var fileParameter in options.FileParameters)
450+
foreach (var parameterValue in fileParameter.Value)
451+
{
452+
var content = new StreamContent(parameterValue.Content);
453+
content.Headers.ContentType = new MediaTypeHeaderValue(parameterValue.ContentType);
454+
var fileStreamName = parameterValue.Name ?? "no_name_provided";
455+
456+
multipartContent.Add(content, fileParameter.Key, fileStreamName);
457+
}
458458

459459
return multipartContent;
460460
}
@@ -517,10 +517,6 @@ private HttpRequestMessage NewRequest(
517517
{
518518
request.Content = PrepareMultipartFormDataContent(options);
519519
}
520-
else if (contentType == "application/x-www-form-urlencoded")
521-
{
522-
request.Content = new FormUrlEncodedContent(options.FormParameters);
523-
}
524520
else
525521
{
526522
if (options.Data != null)

src/Infobip.Api.Client/Client/Configuration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class Configuration : IReadableConfiguration
3838
/// Version of the package.
3939
/// </summary>
4040
/// <value>Version of the package.</value>
41-
public const string Version = "3.0.0";
41+
public const string Version = "3.0.1";
4242

4343
private string _dateTimeFormat = Iso8601DateTimeFormat;
4444

@@ -51,7 +51,7 @@ public class Configuration : IReadableConfiguration
5151
public Configuration()
5252
{
5353
Proxy = null;
54-
UserAgent = "infobip-api-client-csharp/3.0.0";
54+
UserAgent = "infobip-api-client-csharp/3.0.1";
5555
BasePath = "http://localhost";
5656
DefaultHeaders = new ConcurrentDictionary<string, string>();
5757

src/Infobip.Api.Client/Client/FileParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class FileParameter
2525
public FileParameter(Stream content)
2626
{
2727
if (content is FileStream fs)
28-
Name = fs.Name;
28+
Name = Path.GetFileName(fs.Name);
2929

3030
Content = content;
3131
}

src/Infobip.Api.Client/Client/RequestOptions.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111

12+
using Infobip.Api.Client.Client;
1213
using System.Collections.Generic;
1314
using System.IO;
1415
using System.Net;
@@ -27,8 +28,8 @@ public class RequestOptions
2728
public RequestOptions()
2829
{
2930
Cookies = new List<Cookie>();
30-
FileParameters = new Dictionary<string, Stream>();
31-
FormParameters = new Dictionary<string, string>();
31+
FileParameters = new Multimap<string, FileParameter>();
32+
FormParameters = new Multimap<string, string>();
3233
HeaderParameters = new Multimap<string, string>();
3334
PathParameters = new Dictionary<string, string>();
3435
QueryParameters = new Multimap<string, string>();
@@ -47,12 +48,12 @@ public RequestOptions()
4748
/// <summary>
4849
/// File parameters to be sent along with the request.
4950
/// </summary>
50-
public IDictionary<string, Stream> FileParameters { get; set; }
51+
public Multimap<string, FileParameter> FileParameters { get; set; }
5152

5253
/// <summary>
5354
/// Form parameters to be sent along with the request.
5455
/// </summary>
55-
public IDictionary<string, string> FormParameters { get; set; }
56+
public Multimap<string, string> FormParameters { get; set; }
5657

5758
/// <summary>
5859
/// Header parameters to be applied to to the request.

src/Infobip.Api.Client/Infobip.Api.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<Description>C# library for consuming Infobip&#39;s API</Description>
1313
<Copyright>Copyright @ Infobip ltd. All rights reserved.</Copyright>
1414
<RootNamespace>Infobip.Api.Client</RootNamespace>
15-
<Version>3.0.0</Version>
16-
<FileVersion>3.0.0</FileVersion>
17-
<AssemblyVersion>3.0.0</AssemblyVersion>
15+
<Version>3.0.1</Version>
16+
<FileVersion>3.0.1</FileVersion>
17+
<AssemblyVersion>3.0.1</AssemblyVersion>
1818
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Infobip.Api.Client.xml</DocumentationFile>
1919
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2020
<RepositoryUrl>https://github.com/infobip/infobip-api-csharp-client.git</RepositoryUrl>

0 commit comments

Comments
 (0)