Questions tagged [httpcontent]

79 questions
1
vote
1 answer

Get response code, headers and contents from curl_exec

I can't seem to figure out a way to get response code, headers and contents from my curl_exec. Here's my last attempt: $url = '...'; $curl = curl_init($url); curl_setopt($curl, CURLOPT_CAINFO, 'PATH_TO_.cer'); curl_setopt($curl,…
1
vote
1 answer

Custom HttpContent fails while uploading

I have an cross platform library (.net framework 4.6.2, .net standard 2.0 and uwp). I've created a progressable stream content for uploading purpose. In .net framework and .net standard everything is working perfectly but in UWP is not. In uwp…
DevELopE
  • 87
  • 1
  • 10
1
vote
1 answer

HttpContent.ReadAsMultipartAsync leaves behind a temporary file

I'm starting to go loopy on this one, which normally means I'm missing something obvious. I have the following code in my .NET MVC controller: var provider = new CustomMultipartFileStreamProvider("prefix", GetRepositoryTempFolder()); await…
Matt Zamec
  • 73
  • 6
1
vote
1 answer

Can't access the body of HttpResponseMessage

I'm currently working on an API with .NET Core Web App for a test and I'm stuck on this. Actually, I have this code: namespace CoreWebApp.API.Admin { [Route("api/country")] public class CountryController : Controller { // GET:…
Emixam23
  • 3,854
  • 8
  • 50
  • 107
1
vote
1 answer

Custom HttpContent won't build - Could not AOT the assembly (mtouch)

In my efforts to create a progress indicator for uploading videos using HttpClient (SendAsync) in Xamarin Forms, I now have to ask for assistance. The upload itself works fine, and all other API calls, but when I try to create a custom HttpContent…
Mackan
  • 6,200
  • 2
  • 25
  • 45
1
vote
2 answers

How to get HttpContent from Request object?

If a caller adds HttpContent: using (var content = new MultipartFormDataContent()) { HttpContent additionalContent = StringContent("just a test"); content.Add(additionalContent); Which is then POST'ed, how does the receiver retrieve this…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
1
vote
1 answer

HandleHttpRequest Failed with SERVICE_UNAVAILABLE when "rate of the dataflow is exceeding the provenance recording rate"

I have a batch test using jMeter who sends several HTTP requests (GET) to processor NIFI using HandleHttpRequest and sends to Topic Kafka. The problem is StandardHTTPContextMap returns SERVICE_UNAVAILABLE error, it seems this happens when rate of…
galix85
  • 167
  • 3
  • 13
1
vote
1 answer

Web API - Setting Response.Content with byte[] / MemoryStream Contents not working properly

My requirement is to use Web API to send across the network, a zip file (consisting a bunch of files in turn) which should not be written anywhere locally (not written anywhere on the server/client disk). For zipping, I am using DotNetZip -…
vamsee
  • 31
  • 1
  • 9
1
vote
1 answer

Netty HttpRequest including Json

I am trying to build and HTTP request to our Rackspace CDN I need to add a Json string as content to give the login instructions I used curl to test the info and it works but through Netty I get a 400 Bad Request response which tells me I am not…
Louis Biron
  • 113
  • 1
  • 10
1
vote
1 answer

How to execute all http-links from a website?

I have a task to write a program on C#, which finds all http-links from a website. Now I've write a such function for it: async static void DownloadWebPage(string url) { using (HttpClient client = new HttpClient()) using (HttpResponseMessage…
pragmus
  • 3,513
  • 3
  • 24
  • 46
1
vote
1 answer

How can I identify the content-type after opening an HTTP connection?

I am opening an HTTP connection to a URL that I am generating within my program: String url = INPUT_URL; HttpURLConnection connection; while (true) { connection = (HttpURLConnection)new URL(url).openConnection(); …
barak manos
  • 29,648
  • 10
  • 62
  • 114
1
vote
1 answer

Allow my Tumblr blog's content to be accessed by another page

I'm attempting to copy all of the actual content from my Tumblr blog using a script I wrote on a different web page, but I'm having a bit of trouble with gaining access to the content. My ajax call is as follows: $.ajax({ url:…
Zach Saucier
  • 24,871
  • 12
  • 85
  • 147
0
votes
0 answers

Downloading (specific) webpages in C#

I'm having trouble downloading specific webpages using C#. I'd like to download public transport timetables from this page: https://rozklady.mpk.krakow.pl/?lang=EN When you click a line (e.g. "1") and choose a stop (e.g. the 1st one), the address…
JacekM
  • 1
  • 1
0
votes
1 answer

Content.ReadAsStringAsync() json result adding an extra hour to datetime property

Content.ReadAsStringAsync() result adding an extra hour to datetime property. Here is what i get when call endpoint on postman; The ReadAsStringAsync json result return an extra hour to datetime property. string result =…
user1263981
  • 2,953
  • 8
  • 57
  • 98
0
votes
1 answer

HttpClient headers vs HttpContent headers

In c# why both HttpClient and HttpContent have headers. What is difference between them. When should I use client headers and when content headers ? CODE EXAMPLE: HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("Test header",…
user17686011