Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

method GetPostContent don´t permit too long uri #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/Amazon.Sqs/SqsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,25 @@ public async Task<DeleteMessageBatchResultEntry[]> DeleteMessageBatchAsync(Uri q

#region Helpers

private static FormUrlEncodedContent GetPostContent(SqsRequest request)
private static ByteArrayContent GetPostContent(SqsRequestLAI request)
{
request.Add("Version", Version);

return new FormUrlEncodedContent(request.Parameters);
// Converting the dictionary for Form Url protocol
var parameters = new List<string>();
foreach (var item in request.Parameters)
{
var key = WebUtility.UrlEncode(item.Key);
var value = WebUtility.UrlEncode(item.Value);
parameters.Add($"{key}={value}");
}

// Creating a variable for simply the Debug proccess
string paramString = string.Join("&", parameters);

// Creating a variable for simply the Debug proccess
var content = new StringContent(paramString, null, "application/x-www-form-urlencoded");
return content;
}

protected override async Task<Exception> GetExceptionAsync(HttpResponseMessage response)
Expand Down