question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to post a http request without cookie in headers?

See original GitHub issue

Here is my pact file

    {
  "consumer": {
    "name": "consumer"
  },
  "provider": {
    "name": "provider"
  },
  "interactions": [
    {
      "description": "for pact",
      "providerState": "test service.",
      "request": {
        "method": "post",
        "path": "/uri",
        "headers": {
          "Content-Type": "application/json"
        },
        "body": {
          "key": "value"
        }
      },
      "response": {
        "status": 200,
        "body": {
          "key": "value"
          }
        }
      }
    }
  ],
  "metadata": {
    "pactSpecification": {
      "version": "2.0.0"
    }
  }
}

And get the header of post request by wireshark :

POST /uri HTTP/1.1
Cookie: 
Host: 127.0.0.1:8080
Content-Length: 57
Content-Type: application/json 

Due to the exist of Cookie in header, my provider can not response correctly. How can I remove it from header?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bethesquecommented, Sep 30, 2022

Looks like it sets a blank cookie for every request. Unfortunately, there’s nothing the pact library can do about that.

https://github.com/rack/rack-test/blob/v1.1.0/lib/rack/mock_session.rb#L27

0reactions
mefellowscommented, Oct 3, 2022

Closing as a won’t fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using HTTP cookies - MDN Web Docs
After receiving an HTTP request, a server can send one or more Set-Cookie headers with the response. The browser usually stores the cookie...
Read more >
7 Keys to the Mystery of a Missing Cookie - Medium
Check out the OPTIONS response header ACCESS-CONTROL-ALLOW-CREDENTIAL whether it is set to true . If the server doesn't allow credentials being ...
Read more >
HTTP headers | Cookie - GeeksforGeeks
To check this Cookie in action go to Inspect Element -> Network check the request header for Cookie like below, Cookie is highlighted...
Read more >
How do I send a request with Cookies? - ReqBin
To send an HTTP request with a Cookie, you need to add the "Cookie: name=value" header to your request. To send multiple cookies...
Read more >
What are HTTP cookies - Juhana Jauhiainen
Cookies are used typically to tell if two HTTP requests come from ... server in the Set-Cookie header, to every request it will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found