wasSharp – Diff between revs 30 and 34
?pathlinks?
Rev 30 | Rev 34 | |||
---|---|---|---|---|
Line 412... | Line 412... | |||
412 | public async Task<byte[]> GET(string URL, Dictionary<string, string> message) |
412 | public async Task<byte[]> GET(string URL, Dictionary<string, string> message) |
|
413 | { |
413 | { |
|
414 | try |
414 | try |
|
415 | { |
415 | { |
|
416 | using (var response = |
416 | using (var response = |
|
417 | await HTTPClient.GetAsync(URL + "?" + KeyValue.Encode(message))) |
417 | await HTTPClient.GetAsync($"{URL}?{KeyValue.Encode(message)}")) |
|
418 | { |
418 | { |
|
- | 419 | return response.IsSuccessStatusCode ? |
||
419 | return response.IsSuccessStatusCode ? await response.Content.ReadAsByteArrayAsync() : null; |
420 | await response.Content.ReadAsByteArrayAsync() : null; |
|
420 | } |
421 | } |
|
421 | } |
422 | } |
|
422 | catch (Exception) |
423 | catch (Exception) |
|
423 | { |
424 | { |
|
424 | return null; |
425 | return null; |
|
Line 436... | Line 437... | |||
436 | { |
437 | { |
|
437 | try |
438 | try |
|
438 | { |
439 | { |
|
439 | using (var response = await HTTPClient.GetAsync(URL)) |
440 | using (var response = await HTTPClient.GetAsync(URL)) |
|
440 | { |
441 | { |
|
- | 442 | return response.IsSuccessStatusCode ? |
||
441 | return response.IsSuccessStatusCode ? await response.Content.ReadAsByteArrayAsync() : null; |
443 | await response.Content.ReadAsByteArrayAsync() : null; |
|
442 | } |
444 | } |
|
443 | } |
445 | } |
|
444 | catch (Exception) |
446 | catch (Exception) |
|
445 | { |
447 | { |
|
446 | return null; |
448 | return null; |