-
Notifications
You must be signed in to change notification settings - Fork 722
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Little code refactoring, starting with a good code 😄 Ref #21
- Loading branch information
Showing
3 changed files
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
import json | ||
|
||
from base64 import b64encode | ||
|
||
|
||
class RequestInfo: | ||
def __init__(self, url, payload): | ||
def __init__(self, url): | ||
self.url = url | ||
self.payload = payload | ||
self.payload = None | ||
|
||
def encode_payload(self): | ||
json_event = json.dumps(self.payload, separators=(",", ":")) | ||
return {"data": (b64encode(json_event.encode("utf-8"))).decode("utf-8")} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters