Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. string serviceUrl = Dts.Variables["$Project::ServiceUrl"].Value.ToString();    
  2.                 HttpClient client = new HttpClient();    
  3.                 client.BaseAddress = new Uri(serviceUrl);    
  4.                 // Add an Accept header for JSON format.    
  5.                 client.DefaultRequestHeaders.Accept.Add(    
  6.                     new MediaTypeWithQualityHeaderValue("application/json"));
  7.  
  8. ------->>> tutaj brakuje mi coΕ› tkaiego bym miaΕ‚: POST https://blabla.pl/api/transfers
  9.             { "TransferKey":"NDD",
  10.               "SourceID":"0321-2103-3021321231",
  11.               "SourceCode":"ALEALE"
  12.         }  
  13.                 TUTAJ JAKOS TE DANE MUSZE W POST WRZUCIC
  14. -----<<<
  15.  
  16. if (response.IsSuccessStatusCode)    
  17.                 {    
  18.                     var result = response.Content.ReadAsAsync<Response>().Result;    
  19. Dts.TaskResult = (int)ScriptResults.Success;    
  20.                 }    
  21.             }    
  22.             catch (Exception ex)    
  23.             {    
  24.                 Dts.TaskResult = (int)ScriptResults.Failure;    
  25.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement