Skip to content

Commit

Permalink
Properly encode DigiKey part numbers if the contain slashes or other …
Browse files Browse the repository at this point in the history
…non-URL friendly characters
  • Loading branch information
shaun-leach authored and replaysMike committed Mar 13, 2024
1 parent bed3ea6 commit afb7fcc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Binner/Library/Binner.Common/Integrations/DigikeyApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public async Task<IApiResponse> GetProductDetailsAsync(string partNumber, Dictio
return await WrapApiRequestAsync(authResponse, async (authenticationResponse) =>
{
try
{
// set what fields we want from the API
var uri = Url.Combine(_configuration.ApiUrl, "Search/v3/Products/", partNumber);
{
// set what fields we want from the API
var uri = Url.Combine(_configuration.ApiUrl, "Search/v3/Products/", HttpUtility.UrlEncode(partNumber));
var requestMessage = CreateRequest(authenticationResponse, HttpMethod.Get, uri);
// perform a keywords API search
var response = await _client.SendAsync(requestMessage);
Expand Down

0 comments on commit afb7fcc

Please sign in to comment.