Repository: snowplow/snowplow-python-tracker

Issue:
Change default method to POST in emitter
As we have been doing on other trackers, we should also move to `POST` as the default method for making requests to the Collector.

I think there is one thing to consider before we do that: If using GET, the behaviour is intuitive – an event is sent right after it is tracked. If we move to POST with default buffer size 10, users might get confused because the tracker won't send any events if they track less than 10 events unless they call `flush()`. Also, since we only have an in-memory event queue, some events may get lost of users are not aware of the buffering. I can see several options on how to make this experience less confusing for users:

1. Set the default buffer size to 1
2. Document better that one needs to call flush when they want to see events sent to the collector and also before closing their app
3. Add a timer to the emitter that automatically flushes the events after some time (similar like mobile trackers but I don't think that this pattern is suitable for server-side apps)

I think that we should go with option 1 as that is the most intuitive when users are starting with the tracker. We should also document better how to make use of the buffer and how to call the flush. Opening this for discussion if there are other opinions.

Discussion:
snowplowcla: Thanks for your pull request. Is this your first contribution to a Snowplow open source project? Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://docs.snowplowanalytics.com/docs/contributing/contributor-license-agreement/ to learn more and sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


Patch:
diff --git a/examples/app.py b/examples/app.py
index 829055d..973f5a9 100644
--- a/examples/app.py
+++ b/examples/app.py
@@ -19,7 +19,7 @@ def main():
 
     t = Tracker(e, s)
 
-    print("Sending events to " + collector_url)
+    print("Sending events to " + e.endpoint)
 
     t.track_page_view("https://www.snowplow.io", "Homepage")
     t.track_page_ping("https://www.snowplow.io", "Homepage")
@@ -32,6 +32,7 @@ def main():
         )
     )
     t.track_struct_event("shop", "add-to-basket", None, "pcs", 2)
+    t.flush()
 
 
 if __name__ == "__main__":
diff --git a/snowplow_tracker/celery/celery_emitter.py b/snowplow_tracker/celery/celery_emitter.py
index e7a8efa..d9aafaa 100644
--- a/snowplow_tracker/celery/celery_emitter.py
+++ b/snowplow_tracker/celery/celery_emitter.py
@@ -52,7 +52,7 @@ class CeleryEmitter(Emitter):
                 endpoint: str,
                 protocol: HttpProtocol = "http",
                 port: Optional[int] = None,
-                method: Method = "get",
+                method: Method = "post",
                 buffer_size: Optional[int] = None,
                 byte_limit: Optional[int] = None) -> None:
             super(CeleryEmitter, self).__init__(endpoint, protocol, port, method, buffer_size, None, None, byte_limit)
diff --git a/snowplow_tracker/emitters.py b/snowplow_tracker/emitters.py
index 0f331ef..d2549d2 100644
--- a/snowplow_tracker/emitters.py
+++ b/snowplow_tracker/emitters.py
@@ -53,7 +53,7 @@ class Emitter(object):
             endpoint: str,
             protocol: HttpProtocol = "https",
             port: Optional[int] = None,
-            method: Method = "get",
+            method: Method = "post",
             buffer_size: Optional[int] = None,
             on_success: Optional[SuccessCallback] = None,
             on_failure: Optional[FailureCallback] = None,
@@ -66,7 +66,7 @@ class Emitter(object):
             :type  protocol:    protocol
             :param port:        The collector port to connect to
             :type  port:        int | None
-            :param method:      The HTTP request method
+            :param method:      The HTTP request method. Defaults to post.
             :type  method:      method
             :param buffer_size: The maximum number of queued events before the buffer is flushed. Default is 10.
             :type  buffer_size: int | None
@@ -118,7 +118,7 @@ class Emitter(object):
             endpoint: str,
             protocol: HttpProtocol = "https",
             port: Optional[int] = None,
-            method: Method = "get") -> str:
+            method: Method = "post") -> str:
         """
             :param endpoint:  The raw endpoint provided by the user
             :type  endpoint:  string
@@ -153,7 +153,7 @@ class Emitter(object):
             If the maximum size has been reached, flushes the buffer.
 
             :param payload:   The name-value pairs for the event
-            :type  payload:   dict(string:\*)
+            :type  payload:   dict(string:\\*)
         """
         with self.lock:
             if self.bytes_queued is not None:
@@ -212,7 +212,7 @@ class Emitter(object):
     def http_get(self, payload: PayloadDict) -> bool:
         """
             :param payload:  The event properties
-            :type  payload:  dict(string:\*)
+            :type  payload:  dict(string:\\*)
         """
         logger.info("Sending GET request to %s..." % self.endpoint)
         logger.debug("Payload: %s" % payload)
@@ -247,7 +247,7 @@ class Emitter(object):
     def send_events(self, evts: PayloadDictList) -> None:
         """
             :param evts: Array of events to be sent
-            :type  evts: list(dict(string:\*))
+            :type  evts: list(dict(string:\\*))
         """
         if len(evts) > 0:
             logger.info("Attempting to send %s events" % len(evts))
@@ -312,7 +312,7 @@ class Emitter(object):
             as `stm` param
 
             :param events: Array of events to be sent
-            :type  events: list(dict(string:\*))
+            :type  events: list(dict(string:\\*))
             :rtype: None
         """
         def update(e: PayloadDict) -> None:
@@ -332,7 +332,7 @@ class AsyncEmitter(Emitter):
             endpoint: str,
             protocol: HttpProtocol = "http",
             port: Optional[int] = None,
-            method: Method = "get",
+            method: Method = "post",
             buffer_size: Optional[int] = None,
             on_success: Optional[SuccessCallback] = None,
             on_failure: Optional[FailureCallback] = None,
diff --git a/snowplow_tracker/payload.py b/snowplow_tracker/payload.py
index 77fa675..bb47a1d 100644
--- a/snowplow_tracker/payload.py
+++ b/snowplow_tracker/payload.py
@@ -54,7 +54,7 @@ class Payload:
             Add a dict of name value pairs to the Payload object
 
             :param  dict_:          Dictionary to be added to the Payload
-            :type   dict_:          dict(string:\*)
+            :type   dict_:          dict(string:\\*)
         """
         for f in dict_:
             self.add(f, dict_[f])
@@ -70,7 +70,7 @@ class Payload:
             Add an encoded or unencoded JSON to the payload
 
             :param  dict_:                  Custom context for the event
-            :type   dict_:                  dict(string:\*) | None
+            :type   dict_:                  dict(string:\\*) | None
             :param  encode_base64:          If the payload is base64 encoded
             :type   encode_base64:          bool
             :param  type_when_encoded:      Name of the field when encode_base64 is set
diff --git a/snowplow_tracker/tracker.py b/snowplow_tracker/tracker.py
index f693e41..16b89d8 100644
--- a/snowplow_tracker/tracker.py
+++ b/snowplow_tracker/tracker.py
@@ -263,7 +263,7 @@ class Tracker:
             :param  element_id:     ID attribute of the HTML element
             :type   element_id:     string_or_none
             :param  element_classes:    Classes of the HTML element
-            :type   element_classes:    list(str) | tuple(str,\*) | None
+            :type   element_classes:    list(str) | tuple(str,\\*) | None
             :param  element_target:     ID attribute of the HTML element
             :type   element_target:     string_or_none
             :param  element_content:    The content of the HTML element
@@ -416,7 +416,7 @@ class Tracker:
             :param  type_:          Type of data the element represents
             :type   type_:          non_empty_string, form_type
             :param  element_classes:    Classes of the HTML element
-            :type   element_classes:    list(str) | tuple(str,\*) | None
+            :type   element_classes:    list(str) | tuple(str,\\*) | None
             :param  context:        Custom context for the event
             :type   context:        context_array | None
             :param  tstamp:         Optional event timestamp in milliseconds
@@ -456,7 +456,7 @@ class Tracker:
             :param  form_id:        ID attribute of the HTML form
             :type   form_id:        non_empty_string
             :param  form_classes:   Classes of the HTML form
-            :type   form_classes:   list(str) | tuple(str,\*) | None
+            :type   form_classes:   list(str) | tuple(str,\\*) | None
             :param  elements:       Classes of the HTML form
             :type   elements:       list(form_element) | None
             :param  context:        Custom context for the event
@@ -611,7 +611,7 @@ class Tracker:
             :param  currency:       The currency the price is expressed in
             :type   currency:       string_or_none
             :param  items:          The items in the transaction
-            :type   items:          list(dict(str:\*)) | None
+            :type   items:          list(dict(str:\\*)) | None
             :param  context:        Custom context for the event
             :type   context:        context_array | None
             :param  tstamp:         Optional event timestamp in milliseconds


Test patch:
diff --git a/snowplow_tracker/test/integration/test_integration.py b/snowplow_tracker/test/integration/test_integration.py
index 2346243..c487bb7 100644
--- a/snowplow_tracker/test/integration/test_integration.py
+++ b/snowplow_tracker/test/integration/test_integration.py
@@ -36,9 +36,9 @@ from snowplow_tracker.redis import redis_emitter
 
 querystrings = [""]
 
-default_emitter = emitters.Emitter("localhost", protocol="http", port=80)
+default_emitter = emitters.Emitter("localhost", protocol="http", port=80, buffer_size=1)
 
-post_emitter = emitters.Emitter("localhost", protocol="http", port=80, method='post', buffer_size=1)
+get_emitter = emitters.Emitter("localhost", protocol="http", port=80, method='get')
 
 default_subject = subject.Subject()
 
@@ -79,7 +79,7 @@ def fail_response_content(url: str, request: Any) -> Dict[str, Any]:
 class IntegrationTest(unittest.TestCase):
 
     def test_integration_page_view(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject)
+        t = tracker.Tracker([get_emitter], default_subject)
         with HTTMock(pass_response_content):
             t.track_page_view("http://savethearctic.org", "Save The Arctic", "http://referrer.com")
         expected_fields = {"e": "pv", "page": "Save+The+Arctic", "url": "http%3A%2F%2Fsavethearctic.org", "refr": "http%3A%2F%2Freferrer.com"}
@@ -87,7 +87,7 @@ class IntegrationTest(unittest.TestCase):
             self.assertEqual(from_querystring(key, querystrings[-1]), expected_fields[key])
 
     def test_integration_ecommerce_transaction_item(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject)
+        t = tracker.Tracker([get_emitter], default_subject)
         with HTTMock(pass_response_content):
             t.track_ecommerce_transaction_item("12345", "pbz0025", 7.99, 2, "black-tarot", "tarot", currency="GBP")
         expected_fields = {"ti_ca": "tarot", "ti_id": "12345", "ti_qu": "2", "ti_sk": "pbz0025", "e": "ti", "ti_nm": "black-tarot", "ti_pr": "7.99", "ti_cu": "GBP"}
@@ -95,7 +95,7 @@ class IntegrationTest(unittest.TestCase):
             self.assertEqual(from_querystring(key, querystrings[-1]), expected_fields[key])
 
     def test_integration_ecommerce_transaction(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject)
+        t = tracker.Tracker([get_emitter], default_subject)
         with HTTMock(pass_response_content):
             t.track_ecommerce_transaction(
                 "6a8078be", 35, city="London", currency="GBP",
@@ -126,7 +126,7 @@ class IntegrationTest(unittest.TestCase):
         self.assertEqual(from_querystring("ttm", querystrings[-3]), from_querystring("ttm", querystrings[-2]))
 
     def test_integration_screen_view(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=False)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=False)
         with HTTMock(pass_response_content):
             t.track_screen_view("Game HUD 2", id_="534")
         expected_fields = {"e": "ue"}
@@ -146,7 +146,7 @@ class IntegrationTest(unittest.TestCase):
         })
 
     def test_integration_struct_event(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject)
+        t = tracker.Tracker([get_emitter], default_subject)
         with HTTMock(pass_response_content):
             t.track_struct_event("Ecomm", "add-to-basket", "dog-skateboarding-video", "hd", 13.99)
         expected_fields = {"se_ca": "Ecomm", "se_pr": "hd", "se_la": "dog-skateboarding-video", "se_va": "13.99", "se_ac": "add-to-basket", "e": "se"}
@@ -154,7 +154,7 @@ class IntegrationTest(unittest.TestCase):
             self.assertEqual(from_querystring(key, querystrings[-1]), expected_fields[key])
 
     def test_integration_unstruct_event_non_base64(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=False)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=False)
         with HTTMock(pass_response_content):
             t.track_unstruct_event(SelfDescribingJson("iglu:com.acme/viewed_product/jsonschema/2-0-2", {"product_id": "ASO01043", "price$flt": 49.95, "walrus$tms": 1000}))
         expected_fields = {"e": "ue"}
@@ -168,7 +168,7 @@ class IntegrationTest(unittest.TestCase):
         })
 
     def test_integration_unstruct_event_base64(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=True)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=True)
         with HTTMock(pass_response_content):
             t.track_unstruct_event(SelfDescribingJson("iglu:com.acme/viewed_product/jsonschema/2-0-2", {"product_id": "ASO01043", "price$flt": 49.95, "walrus$tms": 1000}))
         expected_fields = {"e": "ue"}
@@ -182,7 +182,7 @@ class IntegrationTest(unittest.TestCase):
         })
 
     def test_integration_context_non_base64(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=False)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=False)
         with HTTMock(pass_response_content):
             t.track_page_view("localhost", "local host", None, [SelfDescribingJson("iglu:com.example/user/jsonschema/2-0-3", {"user_type": "tester"})])
         envelope_string = from_querystring("co", querystrings[-1])
@@ -193,7 +193,7 @@ class IntegrationTest(unittest.TestCase):
         })
 
     def test_integration_context_base64(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=True)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=True)
         with HTTMock(pass_response_content):
             t.track_page_view("localhost", "local host", None, [SelfDescribingJson("iglu:com.example/user/jsonschema/2-0-3", {"user_type": "tester"})])
         envelope_string = unquote_plus(from_querystring("cx", querystrings[-1]))
@@ -212,7 +212,7 @@ class IntegrationTest(unittest.TestCase):
         s.set_timezone("Europe London")
         s.set_lang("en")
 
-        t = tracker.Tracker([emitters.Emitter("localhost")], s, "cf", app_id="angry-birds-android")
+        t = tracker.Tracker([emitters.Emitter("localhost", method='get')], s, "cf", app_id="angry-birds-android")
         with HTTMock(pass_response_content):
             t.track_page_view("localhost", "local host")
         expected_fields = {"tna": "cf", "res": "100x200",
@@ -232,7 +232,7 @@ class IntegrationTest(unittest.TestCase):
         s.set_useragent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)")
         s.set_network_user_id("fbc6c76c-bce5-43ce-8d5a-31c5")
 
-        t = tracker.Tracker([emitters.Emitter("localhost")], s, "cf", app_id="angry-birds-android")
+        t = tracker.Tracker([emitters.Emitter("localhost", method='get')], s, "cf", app_id="angry-birds-android")
         with HTTMock(pass_response_content):
             t.track_page_view("localhost", "local host")
         expected_fields = {
@@ -251,7 +251,7 @@ class IntegrationTest(unittest.TestCase):
         s.set_domain_user_id("4616bfb38f872d16")
         s.set_lang("ES")
 
-        t = tracker.Tracker([emitters.Emitter("localhost")], s, "cf", app_id="angry-birds-android")
+        t = tracker.Tracker([emitters.Emitter("localhost", method='get')], s, "cf", app_id="angry-birds-android")
         evSubject = subject.Subject().set_domain_user_id("1111aaa11a111a11").set_lang("EN")
         with HTTMock(pass_response_content):
             t.track_page_view("localhost", "local host", event_subject=evSubject)
@@ -293,6 +293,7 @@ class IntegrationTest(unittest.TestCase):
         callback_failure_queue = []
         callback_emitter = emitters.Emitter(
             "localhost",
+            method='get',
             on_success=lambda x: callback_success_queue.append(x),
             on_failure=lambda x, y: callback_failure_queue.append(x))
         t = tracker.Tracker([callback_emitter], default_subject)
@@ -312,6 +313,7 @@ class IntegrationTest(unittest.TestCase):
         callback_failure_queue = []
         callback_emitter = emitters.Emitter(
             "localhost",
+            method='get',
             on_success=lambda x: callback_success_queue.append(x),
             on_failure=lambda x, y: callback_failure_queue.append(x))
         t = tracker.Tracker([callback_emitter], default_subject)
@@ -321,7 +323,7 @@ class IntegrationTest(unittest.TestCase):
         self.assertEqual(callback_failure_queue[0], 0)
 
     def test_post_page_view(self) -> None:
-        t = tracker.Tracker([post_emitter], default_subject)
+        t = tracker.Tracker([default_emitter], default_subject)
         with HTTMock(pass_post_response_content):
             t.track_page_view("localhost", "local host", None)
         expected_fields = {"e": "pv", "page": "local host", "url": "localhost"}
@@ -331,8 +333,8 @@ class IntegrationTest(unittest.TestCase):
             self.assertEqual(request["data"][0][key], expected_fields[key])
 
     def test_post_batched(self) -> None:
-        post_emitter = emitters.Emitter("localhost", protocol="http", port=80, method='post', buffer_size=2)
-        t = tracker.Tracker(post_emitter, default_subject)
+        default_emitter = emitters.Emitter("localhost", protocol="http", port=80, buffer_size=2)
+        t = tracker.Tracker(default_emitter, default_subject)
         with HTTMock(pass_post_response_content):
             t.track_struct_event("Test", "A")
             t.track_struct_event("Test", "B")
@@ -341,7 +343,7 @@ class IntegrationTest(unittest.TestCase):
 
     @freeze_time("2021-04-19 00:00:01")  # unix: 1618790401000
     def test_timestamps(self) -> None:
-        emitter = emitters.Emitter("localhost", protocol="http", port=80, method='post', buffer_size=3)
+        emitter = emitters.Emitter("localhost", protocol="http", port=80, buffer_size=3)
         t = tracker.Tracker([emitter], default_subject)
         with HTTMock(pass_post_response_content):
             t.track_page_view("localhost", "stamp0", None, tstamp=None)
@@ -361,18 +363,18 @@ class IntegrationTest(unittest.TestCase):
             self.assertEqual(request["data"][i].get("stm"), expected_timestamps[i]["stm"])
 
     def test_bytelimit(self) -> None:
-        post_emitter = emitters.Emitter("localhost", protocol="http", port=80, method='post', buffer_size=5, byte_limit=420)
-        t = tracker.Tracker(post_emitter, default_subject)
+        default_emitter = emitters.Emitter("localhost", protocol="http", port=80, buffer_size=5, byte_limit=420)
+        t = tracker.Tracker(default_emitter, default_subject)
         with HTTMock(pass_post_response_content):
             t.track_struct_event("Test", "A")       # 140 bytes
             t.track_struct_event("Test", "A")       # 280 bytes
             t.track_struct_event("Test", "A")       # 420 bytes. Send
             t.track_struct_event("Test", "AA")      # 141
         self.assertEqual(len(querystrings[-1]["data"]), 3)
-        self.assertEqual(post_emitter.bytes_queued, 136 + len(_version.__version__))
+        self.assertEqual(default_emitter.bytes_queued, 136 + len(_version.__version__))
 
     def test_unicode_get(self) -> None:
-        t = tracker.Tracker([default_emitter], default_subject, encode_base64=False)
+        t = tracker.Tracker([get_emitter], default_subject, encode_base64=False)
         unicode_a = u'\u0107'
         unicode_b = u'test.\u0107om'
         test_ctx = SelfDescribingJson('iglu:a.b/c/jsonschema/1-0-0', {'test': unicode_a})
@@ -396,7 +398,7 @@ class IntegrationTest(unittest.TestCase):
         self.assertEqual(actual_b, unicode_b)
 
     def test_unicode_post(self) -> None:
-        t = tracker.Tracker([post_emitter], default_subject, encode_base64=False)
+        t = tracker.Tracker([default_emitter], default_subject, encode_base64=False)
         unicode_a = u'\u0107'
         unicode_b = u'test.\u0107om'
         test_ctx = SelfDescribingJson('iglu:a.b/c/jsonschema/1-0-0', {'test': unicode_a})
diff --git a/snowplow_tracker/test/unit/test_emitters.py b/snowplow_tracker/test/unit/test_emitters.py
index 00ff68c..51b107d 100644
--- a/snowplow_tracker/test/unit/test_emitters.py
+++ b/snowplow_tracker/test/unit/test_emitters.py
@@ -54,9 +54,9 @@ class TestEmitters(unittest.TestCase):
 
     def test_init(self) -> None:
         e = Emitter('0.0.0.0')
-        self.assertEqual(e.endpoint, 'https://0.0.0.0/i')
-        self.assertEqual(e.method, 'get')
-        self.assertEqual(e.buffer_size, 1)
+        self.assertEqual(e.endpoint, 'https://0.0.0.0/com.snowplowanalytics.snowplow/tp2')
+        self.assertEqual(e.method, 'post')
+        self.assertEqual(e.buffer_size, 10)
         self.assertEqual(e.buffer, [])
         self.assertIsNone(e.byte_limit)
         self.assertIsNone(e.bytes_queued)
@@ -70,7 +70,7 @@ class TestEmitters(unittest.TestCase):
         self.assertEqual(e.buffer_size, 10)
 
     def test_init_post(self) -> None:
-        e = Emitter('0.0.0.0', method="post")
+        e = Emitter('0.0.0.0')
         self.assertEqual(e.buffer_size, DEFAULT_MAX_LENGTH)
 
     def test_init_byte_limit(self) -> None:
@@ -83,19 +83,19 @@ class TestEmitters(unittest.TestCase):
 
     def test_as_collector_uri(self) -> None:
         uri = Emitter.as_collector_uri('0.0.0.0')
-        self.assertEqual(uri, 'https://0.0.0.0/i')
-
-    def test_as_collector_uri_post(self) -> None:
-        uri = Emitter.as_collector_uri('0.0.0.0', method="post")
         self.assertEqual(uri, 'https://0.0.0.0/com.snowplowanalytics.snowplow/tp2')
 
+    def test_as_collector_uri_get(self) -> None:
+        uri = Emitter.as_collector_uri('0.0.0.0', method='get')
+        self.assertEqual(uri, 'https://0.0.0.0/i')
+
     def test_as_collector_uri_port(self) -> None:
-        uri = Emitter.as_collector_uri('0.0.0.0', port=9090, method="post")
+        uri = Emitter.as_collector_uri('0.0.0.0', port=9090)
         self.assertEqual(uri, 'https://0.0.0.0:9090/com.snowplowanalytics.snowplow/tp2')
 
     def test_as_collector_uri_http(self) -> None:
         uri = Emitter.as_collector_uri('0.0.0.0', protocol="http")
-        self.assertEqual(uri, 'http://0.0.0.0/i')
+        self.assertEqual(uri, 'http://0.0.0.0/com.snowplowanalytics.snowplow/tp2')
 
     def test_as_collector_uri_empty_string(self) -> None:
         with self.assertRaises(ValueError):
@@ -103,11 +103,11 @@ class TestEmitters(unittest.TestCase):
 
     def test_as_collector_uri_endpoint_protocol(self) -> None:
         uri = Emitter.as_collector_uri("https://0.0.0.0")
-        self.assertEqual(uri, "https://0.0.0.0/i")
+        self.assertEqual(uri, "https://0.0.0.0/com.snowplowanalytics.snowplow/tp2")
 
     def test_as_collector_uri_endpoint_protocol_http(self) -> None:
         uri = Emitter.as_collector_uri("http://0.0.0.0")
-        self.assertEqual(uri, "http://0.0.0.0/i")
+        self.assertEqual(uri, "http://0.0.0.0/com.snowplowanalytics.snowplow/tp2")
         
     @mock.patch('snowplow_tracker.Emitter.flush')
     def test_input_no_flush(self, mok_flush: Any) -> None:
@@ -173,7 +173,7 @@ class TestEmitters(unittest.TestCase):
     def test_input_bytes_post(self, mok_flush: Any) -> None:
         mok_flush.side_effect = mocked_flush
 
-        e = Emitter('0.0.0.0', method="post")
+        e = Emitter('0.0.0.0')
         nvPairs = {"testString": "test", "testNum": 2.72}
         e.input(nvPairs)
 
@@ -219,7 +219,7 @@ class TestEmitters(unittest.TestCase):
     def test_flush_timer(self, mok_flush: Any) -> None:
         mok_flush.side_effect = mocked_flush
 
-        e = Emitter('0.0.0.0', method="post", buffer_size=10)
+        e = Emitter('0.0.0.0', buffer_size=10)
         ev_list = [{"a": "aa"}, {"b": "bb"}, {"c": "cc"}]
         for i in ev_list:
             e.input(i)
@@ -261,7 +261,7 @@ class TestEmitters(unittest.TestCase):
         mok_success = mock.Mock(return_value="success mocked")
         mok_failure = mock.Mock(return_value="failure mocked")
 
-        e = Emitter('0.0.0.0', method="post", buffer_size=10, on_success=mok_success, on_failure=mok_failure)
+        e = Emitter('0.0.0.0', buffer_size=10, on_success=mok_success, on_failure=mok_failure)
 
         evBuffer = [{"a": "aa"}, {"b": "bb"}, {"c": "cc"}]
         e.send_events(evBuffer)
@@ -274,7 +274,7 @@ class TestEmitters(unittest.TestCase):
         mok_success = mock.Mock(return_value="success mocked")
         mok_failure = mock.Mock(return_value="failure mocked")
 
-        e = Emitter('0.0.0.0', method="post", buffer_size=10, on_success=mok_success, on_failure=mok_failure)
+        e = Emitter('0.0.0.0', buffer_size=10, on_success=mok_success, on_failure=mok_failure)
 
         evBuffer = [{"a": "aa"}, {"b": "bb"}, {"c": "cc"}]
         e.send_events(evBuffer)
@@ -292,7 +292,7 @@ class TestEmitters(unittest.TestCase):
     @mock.patch('snowplow_tracker.emitters.requests.post')
     def test_http_get_connect_timeout_error(self, mok_post_request: Any) -> None:
         mok_post_request.side_effect = ConnectTimeout
-        e = Emitter('0.0.0.0')
+        e = Emitter('0.0.0.0', method='get')
         get_succeeded = e.http_get({"a": "b"})
 
         self.assertFalse(get_succeeded)
@@ -366,7 +366,7 @@ class TestEmitters(unittest.TestCase):
         mok_success = mock.Mock(return_value="success mocked")
         mok_failure = mock.Mock(return_value="failure mocked")
 
-        ae = Emitter('0.0.0.0', method="post", buffer_size=10, on_success=mok_success, on_failure=mok_failure)
+        ae = Emitter('0.0.0.0', buffer_size=10, on_success=mok_success, on_failure=mok_failure)
 
         evBuffer = [{"a": "aa"}, {"b": "bb"}, {"c": "cc"}]
         ae.send_events(evBuffer)
@@ -379,7 +379,7 @@ class TestEmitters(unittest.TestCase):
         mok_success = mock.Mock(return_value="success mocked")
         mok_failure = mock.Mock(return_value="failure mocked")
 
-        ae = Emitter('0.0.0.0', method="post", buffer_size=10, on_success=mok_success, on_failure=mok_failure)
+        ae = Emitter('0.0.0.0', buffer_size=10, on_success=mok_success, on_failure=mok_failure)
 
         evBuffer = [{"a": "aa"}, {"b": "bb"}, {"c": "cc"}]
         ae.send_events(evBuffer)
@@ -403,7 +403,7 @@ class TestEmitters(unittest.TestCase):
         mok_flush.side_effect = mocked_flush
 
         payload = {"unicode": u'\u0107', "alsoAscii": "abc"}
-        ae = AsyncEmitter('0.0.0.0', method="post", buffer_size=2)
+        ae = AsyncEmitter('0.0.0.0', buffer_size=2)
         ae.input(payload)
 
         self.assertEqual(len(ae.buffer), 1)