Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:07:54+00:00 2026-06-13T10:07:54+00:00

I am having a problem. It deals with a web service using POST method

  • 0

I am having a problem. It deals with a web service using POST method with cURL.
I am trying to compress the request with GZIP,DEFLATE.
If you look on line three this is how it was done.

     $x = curl_init("http://url");
  curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  **curl_setopt($x, CURLOPT_ENCODING, 'Accept-Encoding: gzip,deflate');** 
  curl_setopt($x, CURLOPT_POST, 1);
  curl_setopt($x, CURLOPT_POSTFIELDS, $inputdata);
  curl_setopt($x, CURLOPT_FOLLOWLOCATION, 0);
  curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);
  $data = curl_exec($x);

I get a response HTTP/1.1 200 OK Date: Mon, 22 Oct 2012 16:19:23 GMT Server: Resin/1.11.14 Content-Type: text/xml; charset=UTF-8 Vary: Accept-Encoding Content-Encoding: gzip Content-Length: 2088

However, The web service provider says that it is not compressed. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:07:55+00:00Added an answer on June 13, 2026 at 10:07 am

    You don’t need to put in the full header when setting CURLOPT_ENCODING, just set it to an empty string, and curl will put in the supported encodings.

    curl_setopt($x, CURLOPT_ENCODING, '')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem parsing the data being returned by my WCF web service.
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working
We have a web service which provides search over hotels. There is a problem
The problem I'm having with writing a web application architecture is that I want
I am having a problem with AIF in AX 2012 when it deals with
i'm having problem to deal with charset in ruby on rails app, specificially in
I'm having a problem getting XCode to deal with a particular file structure that
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
Im having problem in my UIscrollView ,this is what I have done: Whenever a
I am having problem with previewing custom performance counters with PerflibV2. Performance Monitor shows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.