Giter Site home page Giter Site logo

Comments (9)

f2prateek avatar f2prateek commented on May 27, 2024

hey @sandarsh-sridhar-cliq the library sends the data as an authorization header (

_httpClient.Headers.Add("Authorization", "Basic " + BasicAuthHeader(batch.WriteKey, string.Empty));
). I believe it's the API and debugger that maybe show this in the body - I might suggest you write in via our support form so our support team can get the right team to answer this!

from analytics.net.

sandarsh-sridhar-cliq avatar sandarsh-sridhar-cliq commented on May 27, 2024

Thank you for responding to the issue this quickly. I had gone through that snippet of code. It absolutely makes sense to have the write key in a strongly typed class. But that property can be ignored during serialization with JsonIgnore property from Newtonsoft.json, so that it doesn't make it to the event data itself.

from analytics.net.

f2prateek avatar f2prateek commented on May 27, 2024

Ah... I see what you mean. It's because we convert the batch object to JSON directly here

string json = JsonConvert.SerializeObject(batch);
, causing the writeKey to be sent.

from analytics.net.

sandarsh-sridhar-cliq avatar sandarsh-sridhar-cliq commented on May 27, 2024

That's correct. So, when you annotate the WriteKey property with JsonIgnore, it wouldn't make it to the payload but you will still be able to make the POST request.

from analytics.net.

f2prateek avatar f2prateek commented on May 27, 2024

Cool - I've opened a ticket internally to track this. We'll post here when there's an update!

from analytics.net.

sandarsh-sridhar-cliq avatar sandarsh-sridhar-cliq commented on May 27, 2024

Thank you. I appreciate it. :)

from analytics.net.

f2prateek avatar f2prateek commented on May 27, 2024

I was doing some testing, and it looks like the writeKey is copied to the body, even if you only send it in the header.

Here's an example:

curl -X "POST" "https://api.segment.io/v1/import" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -u '{writeKey}:' \
     -d $'{
  "batch": [
    {
      "type": "track",
      "userId": "prateek",
      "event": "Button Clicked"
    }
  ]
}'

So even if we made a fix here, it wouldn't actually fix the underlying issue. I'd recommend opening a support issue - so they can route this to the right folks and notify you if there is an update. I'll ping the team about this directly as well!

from analytics.net.

sandarsh-sridhar-cliq avatar sandarsh-sridhar-cliq commented on May 27, 2024

Hmm...That's interesting. Well, thank you for trying though. Yeah, I shall open a support issue.
Thanks again.

from analytics.net.

nd4p90x avatar nd4p90x commented on May 27, 2024

Confirmed that the writeKey is not being displayed in the current version, Thank you.

from analytics.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.