Repository navigation
Conversation
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
| - **as python requests (custom filtering)** - Python implementation with custom header filtering | ||
| - **Advanced...** - Convert request to a different content-type and language | ||
|
|
||
| ## Advanced Copy Feature |
There was a problem hiding this comment.
make this much shorter paragraph will be sufficient
There was a problem hiding this comment.
Simplified to a single paragraph in b54e767
| def _from_dict(data_dict, content_type): | ||
| """Convert dictionary to target content type format.""" | ||
| if content_type == "application/json": | ||
| return data_dict |
There was a problem hiding this comment.
all these ifs return the sama data_dict...
There was a problem hiding this comment.
Fixed - simplified to return data_dict directly since all formats use dict internally in b54e767
| class ContentTypeConverter: | ||
| """ | ||
| Converts request body data between different content types. | ||
| Supports conversions between: |
There was a problem hiding this comment.
That's bad. Multipart should be supported too.
There was a problem hiding this comment.
Added multipart/form-data support in b54e767
| if content_type_index < 0 or content_type_index >= len(supported_types): | ||
| raise ValueError("Invalid content type selection") | ||
|
|
||
| if language not in ['js', 'python']: |
There was a problem hiding this comment.
If you need supported langs, dont hardcode, make them globally available from one place and access from it
There was a problem hiding this comment.
Added SUPPORTED_LANGUAGES constant at module level in b54e767
…ort, use constant for languages Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Co-authored-by: tomek7667 <38402753+tomek7667@users.noreply.github.com>
Adds "Advanced..." menu option to convert request bodies between content-types (JSON, form-urlencoded, and multipart) while automatically updating the Content-Type header.
Changes
Content-type converter (
content_type_converter.py)application/json,application/x-www-form-urlencoded, andmultipart/form-data_from_dictmethod to remove redundant conditional branchesRequestTree enhancement (
request_tree.py)target_content_typeparameter_url_decodeto prevent IndexError on malformed inputUI addition (
main.py)<content-type-number>,<language>(e.g.,1,jsor2,python)SUPPORTED_LANGUAGESconstant for centralized language configurationTests
Usage
Original JSON request:
{"username": "test", "password": "secret"}Generates code with converted body and updated header:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.