perl - curl not overwriting header fields -


I have to face a problem where overpoint server has sent a '417 Expectation Failed' error to 1024kb Returning I do not believe that the endpoint is sent to the curl before writing it properly.

I am writing in Perl using the I-H flag and reading many different threads, to include the curl manpage, in an attempt to understand what I am doing . Here's how I'm setting my headers.

  My $ curlpath = "/ usr / local / bin / curl"; My $ xml = # - Yes, XML has actually been passed but I pushed it to @ curl_vers, "-h 'content type: text / xml; hope:'"; # - Header Flag Push @ Cirall_vers, "-V"; # - Verbose mode push @curl_vars, "-d"; # - Data Flag Push @curl_vars, $ xml; # - Push Data @ curl_vers, $ endpoint; Eval {# - Command line execution open (file, "-") || Exec $ curlpath, @curl_vars; $ response = join '', & lt; FILE & gt;; close (FILE);};   

There is a curl response trim from the log. myhost.com \ [Fri Oct 10 16:04:36 2014]> Accept: * / * \ r [Fri Oct 10 16:04:36 2014]> 'Content-Type: Text / xml; Expected:' \ R [Fri Oct 10 16:04:36 2014] Content-Length: 1069 \ r [Venus Oct 10 16:04:36 2014]> Content-Type: Apple Cessation / x-www-form-urxored \ r [Fri Oct 10 16:04:36 2014] Expected: 100-Continue \ r [Venus Oct 10 16:04:36 2014] & gt; \ R [Venus 10 October 16:04:36 2014] * HTTP 1.0, Accept the Body [Venus 10 October 16:04:36 2014] HTTP / 1.0 417 Expected Failure [Fri Oct 10 16:04: 36 2014] Connection: Closed \ r [Fri 10 Oct 16:04:36 2014] Content-Length: 18 \ r [Venus 10 October 16:04:36 2014] & lt; Second, open the curl with two-H uses:

  -H Content-Type: Text / Xml '-H' Expected: '  

That is, every -H changes a single header, so for every headers you only need to modify what you want to modify.

Xml '; Push @ circle_war, '-h', 'expected:';

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -