From a03b82f460e684da37ec8b1a972e84ebbb06afba Mon Sep 17 00:00:00 2001 From: Gauravi Jadhav <111783663+Gauravi-2@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:01:37 +0530 Subject: [PATCH] Create fetch_tracking_numbers.py Replacing truncated url with hash with %23 as the hash character is treated as the start of a fragment, which is not sent to the server by default and so # must be percent-encoded to ensure they are sent properly. --- httpie/fetch_tracking_numbers.py | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 httpie/fetch_tracking_numbers.py diff --git a/httpie/fetch_tracking_numbers.py b/httpie/fetch_tracking_numbers.py new file mode 100644 index 0000000000..9abc1bf3f7 --- /dev/null +++ b/httpie/fetch_tracking_numbers.py @@ -0,0 +1,55 @@ +➜ ~ http --debug get 'localhost:5173/api/shopify_fulfillment/fetch_tracking_numbers?order_names[]=#1001.1×tamp=1669900140' +HTTPie 3.2.2 +Requests 2.31.0 +Pygments 2.17.2 +Python 3.12.0 (main, Oct 2 2023, 12:03:24) [Clang 15.0.0 (clang-1500.0.40.1)] +/opt/homebrew/Cellar/httpie/3.2.2_3/libexec/bin/python +Darwin 23.1.0 + +, + 'args': Namespace(), + 'as_silent': , + 'colors': 256, + 'config': {'default_options': []}, + 'config_dir': PosixPath('/Users/francis/.config/httpie'), + 'devnull': , + 'is_windows': False, + 'log_error': , + 'program_name': 'http', + 'quiet': 0, + 'rich_console': , + 'rich_error_console': , + 'show_displays': True, + 'stderr': <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>, + 'stderr_isatty': True, + 'stdin': <_io.TextIOWrapper name='' mode='r' encoding='utf-8'>, + 'stdin_encoding': 'utf-8', + 'stdin_isatty': True, + 'stdout': <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>, + 'stdout_encoding': 'utf-8', + 'stdout_isatty': True}> + +, + , + ], + 'converters': [], + 'formatters': [, + , + , + ]}> + +>>> requests.request(**{'auth': None, + 'data': RequestJSONDataDict(), + 'headers': , + 'method': 'get', + 'params': , + 'url': 'http://localhost:5173/api/shopify_fulfillment/fetch_tracking_numbers?order_names[]=%231001.1 +×tamp=1669900140'}) + +HTTP/1.1 200 OK +Access-Control-Allow-Origin: * +Connection: keep-alive +Date: Tue, 12 Dec 2023 23:50:28 GMT +Keep-Alive: timeout=5 +Transfer-Encoding: chunked