Questions tagged [uploadstring]

19 questions
7
votes
1 answer

Error in using WebClient object REST API call using C#

I am trying to POST an order to REST API using the below code: string URI = "https://api.myTrade.com/s1/order/" + orderId; string myParameters = "symbol=AAPL&duration=day&side=buy&quantity=1&type=limit&price=1"; …
aceventura
  • 219
  • 2
  • 6
  • 15
1
vote
1 answer

UploadStringAsync CallBack Return Type

I have a web service where I Post to a URL Asynchronously public Response uploadXMLData(string destinationUrl, string requestXml,Request req) { try { Response resp=new Response(); System.Uri uri = new…
HelpASisterOut
  • 3,085
  • 16
  • 45
  • 89
1
vote
1 answer

C# - Catch WebException While Posting XML Async

I am POSTING XML data using WebClient. public string uploadXMLData(string destinationUrl, string requestXml) { try { System.Uri uri = new System.Uri(destinationUrl); using (WebClient…
HelpASisterOut
  • 3,085
  • 16
  • 45
  • 89
1
vote
1 answer

c# webClient Upload String cuts off

I need some help with the C# WebClient UploadString Method. I'm trying to upload a long string (that I read from a database) to a server (PHP) and I'm currently trying to do that with the UploadString Method because it seemed to be the easiest. The…
Johannes
  • 29
  • 5
1
vote
1 answer

WebClients uploadstring

I'm using the WebClient to post string to a WebApiController using UploadString. The string Im uploading is an Xml file containing a DateTime in the following format: "yyyy-mm-ddThh:mm:ss.000+zzz". The problem I encounter is that the string is sent…
Rotem B
  • 1,327
  • 1
  • 15
  • 20
1
vote
1 answer

Sending data to a url

I want to send data to a php page, which inserts it in a database. I got the following code from Sending data to php from windows phone from but it shows some errors: On using: System.Net.WebClient: type used in a using statement must be implicitly…
JelleKerkstra
  • 502
  • 2
  • 4
  • 19
1
vote
1 answer

WCF + WebClient + Powershell

I tried it works fine for the asmx (simple web services) but for WCf do we need to do some thing different. Can the Same work for the WCF services as i get the error for the WCF service also. i just created the Simple WCF service in .net and tried…
kiran k
  • 11
  • 1
  • 3
1
vote
2 answers

C# UploadStringAsync not working

I am having a wcf service and I am calling a method like this: public static void f5() { var client = new WebClient(); client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadStringCompleted); …
Varun Sharma
  • 2,591
  • 8
  • 45
  • 63
0
votes
1 answer

UploadString (Post Method) in VB.NET doesn't work

I am trying to post simple data to some site, in this example to a php file on my local server. My VB.NET Code: Dim W As New Net.WebClient Dim A As String = "" W.Encoding = System.Text.Encoding.UTF8 Dim URL As String =…
MilMike
  • 12,571
  • 15
  • 65
  • 82
0
votes
0 answers

SSIS C# Web API UploadString Identify Bad Data

I have an SSIS package which sends data as a string to an external company's Web API via a Post request, and the string is a pipe delimited one derived from thousands of rows retrieved by a SQL query - the data from the SQL table is them passed as a…
GBM
  • 99
  • 6
0
votes
0 answers

Using webforms with API - returns null values

Can anybody help me? This code work fine with no parameter: private void PopulateGridView() { string apiUrl = apiurl + "local_stud_listgrupmenu"; string inputJson = (new JavaScriptSerializer()).Serialize(input); WebClient client =…
atok
  • 1
0
votes
0 answers

UploadStringDataAsync sends nothing

I'm trying to send a json to a php page but result is always empty. try { using (WebClient webclient = new WebClient()) { webclient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); …
Éder Rocha
  • 1,538
  • 11
  • 29
0
votes
0 answers

Getting this error message "Cannot send a content-body with this verb-type."

I'm encountering this message upon WebClient request to the API in C# using the GET method, did I miss something on my code? but when I use the POST method it shows the same output when I test it on PostMan which is the error because POST is not the…
0
votes
1 answer

string parameter in controller is null when using webclient

When I use WebClient to call a function in a controller using (WebClient client = new WebClient()) { client.BaseAddress = "http://localhost/"; client.Headers.Add("Content-Type", "application/json"); client.UploadString("api/test",…
S. Cheng
  • 13
  • 3
0
votes
2 answers

powershell v2 : WebClient/UploadString never connect

with powershell v2 and pushbullet, I try to send push notification when a file in modified $folder = 'c:\path\to\file' $filter = '*.*' $user = "pushbullet_token" $url = "https://api.pushbullet.com/v2/pushes" $fsw = New-Object IO.FileSystemWatcher…
JuanPablo
  • 23,792
  • 39
  • 118
  • 164
1
2