[{"data":1,"prerenderedAt":5374},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/handle-api-requests":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296,"expanded":13},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361,"expanded":13},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417,"expanded":13},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482,"expanded":13},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20,"expanded":13},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[501],{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"body":602,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},{"type":603,"children":604,"toc":5362},"root",[605,614,620,1084,1091,1096,1236,1243,2082,2088,3187,3193,3334,3340,3346,5208,5214,5331,5337,5342,5356],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"handling-api-requests",[611],{"type":612,"value":613},"text","🔗 Handling API Requests",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"APIs (Application Programming Interfaces) let you fetch data from web services, integrate with external platforms, and build connected applications. Python makes it easy to work with RESTful APIs and process JSON responses.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","import urllib.request\nimport json\n\n# Simple API request using built-in urllib\ndef get_api_data(url):\n    try:\n        with urllib.request.urlopen(url) as response:\n            data = response.read()\n            return json.loads(data)\n    except Exception as e:\n        print(f\"Error fetching data: {e}\")\n        return None\n\n# Example with a placeholder API\napi_url = \"https://jsonplaceholder.typicode.com/posts/1\"\npost_data = get_api_data(api_url)\n\nif post_data:\n    print(f\"Post ID: {post_data['id']}\")\n    print(f\"Title: {post_data['title']}\")\n    print(f\"Body: {post_data['body'][:100]}...\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,652,664,672,681,700,713,736,754,768,792,841,854,861,869,886,903,910,923,975,1024],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640,646],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[644],{"type":612,"value":645},"import",{"type":606,"tag":636,"props":647,"children":649},{"style":648},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[650],{"type":612,"value":651}," urllib.request\n",{"type":606,"tag":636,"props":653,"children":654},{"class":638,"line":27},[655,659],{"type":606,"tag":636,"props":656,"children":657},{"style":642},[658],{"type":612,"value":645},{"type":606,"tag":636,"props":660,"children":661},{"style":648},[662],{"type":612,"value":663}," json\n",{"type":606,"tag":636,"props":665,"children":666},{"class":638,"line":36},[667],{"type":606,"tag":636,"props":668,"children":669},{"emptyLinePlaceholder":13},[670],{"type":612,"value":671},"\n",{"type":606,"tag":636,"props":673,"children":674},{"class":638,"line":45},[675],{"type":606,"tag":636,"props":676,"children":678},{"style":677},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[679],{"type":612,"value":680},"# Simple API request using built-in urllib\n",{"type":606,"tag":636,"props":682,"children":683},{"class":638,"line":54},[684,689,695],{"type":606,"tag":636,"props":685,"children":686},{"style":642},[687],{"type":612,"value":688},"def",{"type":606,"tag":636,"props":690,"children":692},{"style":691},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[693],{"type":612,"value":694}," get_api_data",{"type":606,"tag":636,"props":696,"children":697},{"style":648},[698],{"type":612,"value":699},"(url):\n",{"type":606,"tag":636,"props":701,"children":702},{"class":638,"line":63},[703,708],{"type":606,"tag":636,"props":704,"children":705},{"style":642},[706],{"type":612,"value":707},"    try",{"type":606,"tag":636,"props":709,"children":710},{"style":648},[711],{"type":612,"value":712},":\n",{"type":606,"tag":636,"props":714,"children":715},{"class":638,"line":72},[716,721,726,731],{"type":606,"tag":636,"props":717,"children":718},{"style":642},[719],{"type":612,"value":720},"        with",{"type":606,"tag":636,"props":722,"children":723},{"style":648},[724],{"type":612,"value":725}," urllib.request.urlopen(url) ",{"type":606,"tag":636,"props":727,"children":728},{"style":642},[729],{"type":612,"value":730},"as",{"type":606,"tag":636,"props":732,"children":733},{"style":648},[734],{"type":612,"value":735}," response:\n",{"type":606,"tag":636,"props":737,"children":738},{"class":638,"line":81},[739,744,749],{"type":606,"tag":636,"props":740,"children":741},{"style":648},[742],{"type":612,"value":743},"            data ",{"type":606,"tag":636,"props":745,"children":746},{"style":642},[747],{"type":612,"value":748},"=",{"type":606,"tag":636,"props":750,"children":751},{"style":648},[752],{"type":612,"value":753}," response.read()\n",{"type":606,"tag":636,"props":755,"children":757},{"class":638,"line":756},9,[758,763],{"type":606,"tag":636,"props":759,"children":760},{"style":642},[761],{"type":612,"value":762},"            return",{"type":606,"tag":636,"props":764,"children":765},{"style":648},[766],{"type":612,"value":767}," json.loads(data)\n",{"type":606,"tag":636,"props":769,"children":770},{"class":638,"line":99},[771,776,782,787],{"type":606,"tag":636,"props":772,"children":773},{"style":642},[774],{"type":612,"value":775},"    except",{"type":606,"tag":636,"props":777,"children":779},{"style":778},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[780],{"type":612,"value":781}," Exception",{"type":606,"tag":636,"props":783,"children":784},{"style":642},[785],{"type":612,"value":786}," as",{"type":606,"tag":636,"props":788,"children":789},{"style":648},[790],{"type":612,"value":791}," e:\n",{"type":606,"tag":636,"props":793,"children":794},{"class":638,"line":108},[795,800,805,810,816,821,826,831,836],{"type":606,"tag":636,"props":796,"children":797},{"style":778},[798],{"type":612,"value":799},"        print",{"type":606,"tag":636,"props":801,"children":802},{"style":648},[803],{"type":612,"value":804},"(",{"type":606,"tag":636,"props":806,"children":807},{"style":642},[808],{"type":612,"value":809},"f",{"type":606,"tag":636,"props":811,"children":813},{"style":812},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[814],{"type":612,"value":815},"\"Error fetching data: ",{"type":606,"tag":636,"props":817,"children":818},{"style":778},[819],{"type":612,"value":820},"{",{"type":606,"tag":636,"props":822,"children":823},{"style":648},[824],{"type":612,"value":825},"e",{"type":606,"tag":636,"props":827,"children":828},{"style":778},[829],{"type":612,"value":830},"}",{"type":606,"tag":636,"props":832,"children":833},{"style":812},[834],{"type":612,"value":835},"\"",{"type":606,"tag":636,"props":837,"children":838},{"style":648},[839],{"type":612,"value":840},")\n",{"type":606,"tag":636,"props":842,"children":843},{"class":638,"line":117},[844,849],{"type":606,"tag":636,"props":845,"children":846},{"style":642},[847],{"type":612,"value":848},"        return",{"type":606,"tag":636,"props":850,"children":851},{"style":778},[852],{"type":612,"value":853}," None\n",{"type":606,"tag":636,"props":855,"children":856},{"class":638,"line":126},[857],{"type":606,"tag":636,"props":858,"children":859},{"emptyLinePlaceholder":13},[860],{"type":612,"value":671},{"type":606,"tag":636,"props":862,"children":863},{"class":638,"line":135},[864],{"type":606,"tag":636,"props":865,"children":866},{"style":677},[867],{"type":612,"value":868},"# Example with a placeholder API\n",{"type":606,"tag":636,"props":870,"children":871},{"class":638,"line":144},[872,877,881],{"type":606,"tag":636,"props":873,"children":874},{"style":648},[875],{"type":612,"value":876},"api_url ",{"type":606,"tag":636,"props":878,"children":879},{"style":642},[880],{"type":612,"value":748},{"type":606,"tag":636,"props":882,"children":883},{"style":812},[884],{"type":612,"value":885}," \"https://jsonplaceholder.typicode.com/posts/1\"\n",{"type":606,"tag":636,"props":887,"children":888},{"class":638,"line":153},[889,894,898],{"type":606,"tag":636,"props":890,"children":891},{"style":648},[892],{"type":612,"value":893},"post_data ",{"type":606,"tag":636,"props":895,"children":896},{"style":642},[897],{"type":612,"value":748},{"type":606,"tag":636,"props":899,"children":900},{"style":648},[901],{"type":612,"value":902}," get_api_data(api_url)\n",{"type":606,"tag":636,"props":904,"children":905},{"class":638,"line":163},[906],{"type":606,"tag":636,"props":907,"children":908},{"emptyLinePlaceholder":13},[909],{"type":612,"value":671},{"type":606,"tag":636,"props":911,"children":912},{"class":638,"line":172},[913,918],{"type":606,"tag":636,"props":914,"children":915},{"style":642},[916],{"type":612,"value":917},"if",{"type":606,"tag":636,"props":919,"children":920},{"style":648},[921],{"type":612,"value":922}," post_data:\n",{"type":606,"tag":636,"props":924,"children":925},{"class":638,"line":181},[926,931,935,939,944,948,953,958,963,967,971],{"type":606,"tag":636,"props":927,"children":928},{"style":778},[929],{"type":612,"value":930},"    print",{"type":606,"tag":636,"props":932,"children":933},{"style":648},[934],{"type":612,"value":804},{"type":606,"tag":636,"props":936,"children":937},{"style":642},[938],{"type":612,"value":809},{"type":606,"tag":636,"props":940,"children":941},{"style":812},[942],{"type":612,"value":943},"\"Post ID: ",{"type":606,"tag":636,"props":945,"children":946},{"style":778},[947],{"type":612,"value":820},{"type":606,"tag":636,"props":949,"children":950},{"style":648},[951],{"type":612,"value":952},"post_data[",{"type":606,"tag":636,"props":954,"children":955},{"style":812},[956],{"type":612,"value":957},"'id'",{"type":606,"tag":636,"props":959,"children":960},{"style":648},[961],{"type":612,"value":962},"]",{"type":606,"tag":636,"props":964,"children":965},{"style":778},[966],{"type":612,"value":830},{"type":606,"tag":636,"props":968,"children":969},{"style":812},[970],{"type":612,"value":835},{"type":606,"tag":636,"props":972,"children":973},{"style":648},[974],{"type":612,"value":840},{"type":606,"tag":636,"props":976,"children":977},{"class":638,"line":190},[978,982,986,990,995,999,1003,1008,1012,1016,1020],{"type":606,"tag":636,"props":979,"children":980},{"style":778},[981],{"type":612,"value":930},{"type":606,"tag":636,"props":983,"children":984},{"style":648},[985],{"type":612,"value":804},{"type":606,"tag":636,"props":987,"children":988},{"style":642},[989],{"type":612,"value":809},{"type":606,"tag":636,"props":991,"children":992},{"style":812},[993],{"type":612,"value":994},"\"Title: ",{"type":606,"tag":636,"props":996,"children":997},{"style":778},[998],{"type":612,"value":820},{"type":606,"tag":636,"props":1000,"children":1001},{"style":648},[1002],{"type":612,"value":952},{"type":606,"tag":636,"props":1004,"children":1005},{"style":812},[1006],{"type":612,"value":1007},"'title'",{"type":606,"tag":636,"props":1009,"children":1010},{"style":648},[1011],{"type":612,"value":962},{"type":606,"tag":636,"props":1013,"children":1014},{"style":778},[1015],{"type":612,"value":830},{"type":606,"tag":636,"props":1017,"children":1018},{"style":812},[1019],{"type":612,"value":835},{"type":606,"tag":636,"props":1021,"children":1022},{"style":648},[1023],{"type":612,"value":840},{"type":606,"tag":636,"props":1025,"children":1026},{"class":638,"line":199},[1027,1031,1035,1039,1044,1048,1052,1057,1062,1067,1071,1075,1080],{"type":606,"tag":636,"props":1028,"children":1029},{"style":778},[1030],{"type":612,"value":930},{"type":606,"tag":636,"props":1032,"children":1033},{"style":648},[1034],{"type":612,"value":804},{"type":606,"tag":636,"props":1036,"children":1037},{"style":642},[1038],{"type":612,"value":809},{"type":606,"tag":636,"props":1040,"children":1041},{"style":812},[1042],{"type":612,"value":1043},"\"Body: ",{"type":606,"tag":636,"props":1045,"children":1046},{"style":778},[1047],{"type":612,"value":820},{"type":606,"tag":636,"props":1049,"children":1050},{"style":648},[1051],{"type":612,"value":952},{"type":606,"tag":636,"props":1053,"children":1054},{"style":812},[1055],{"type":612,"value":1056},"'body'",{"type":606,"tag":636,"props":1058,"children":1059},{"style":648},[1060],{"type":612,"value":1061},"][:",{"type":606,"tag":636,"props":1063,"children":1064},{"style":778},[1065],{"type":612,"value":1066},"100",{"type":606,"tag":636,"props":1068,"children":1069},{"style":648},[1070],{"type":612,"value":962},{"type":606,"tag":636,"props":1072,"children":1073},{"style":778},[1074],{"type":612,"value":830},{"type":606,"tag":636,"props":1076,"children":1077},{"style":812},[1078],{"type":612,"value":1079},"...\"",{"type":606,"tag":636,"props":1081,"children":1082},{"style":648},[1083],{"type":612,"value":840},{"type":606,"tag":1085,"props":1086,"children":1088},"h2",{"id":1087},"understanding-api-requests",[1089],{"type":612,"value":1090},"🎯 Understanding API Requests",{"type":606,"tag":615,"props":1092,"children":1093},{},[1094],{"type":612,"value":1095},"APIs use HTTP methods to communicate, with JSON being the most common data format for responses.",{"type":606,"tag":1097,"props":1098,"children":1102},"info-box",{"emoji":1099,"title":1100,"type":1101},"🌐","API Basics","info",[1103,1112,1161,1169,1192,1200],{"type":606,"tag":615,"props":1104,"children":1105},{},[1106],{"type":606,"tag":1107,"props":1108,"children":1109},"strong",{},[1110],{"type":612,"value":1111},"HTTP Methods:",{"type":606,"tag":1113,"props":1114,"children":1115},"ul",{},[1116,1128,1139,1150],{"type":606,"tag":1117,"props":1118,"children":1119},"li",{},[1120,1126],{"type":606,"tag":632,"props":1121,"children":1123},{"className":1122},[],[1124],{"type":612,"value":1125},"GET",{"type":612,"value":1127}," - Retrieve data",{"type":606,"tag":1117,"props":1129,"children":1130},{},[1131,1137],{"type":606,"tag":632,"props":1132,"children":1134},{"className":1133},[],[1135],{"type":612,"value":1136},"POST",{"type":612,"value":1138}," - Create new data",{"type":606,"tag":1117,"props":1140,"children":1141},{},[1142,1148],{"type":606,"tag":632,"props":1143,"children":1145},{"className":1144},[],[1146],{"type":612,"value":1147},"PUT",{"type":612,"value":1149}," - Update existing data",{"type":606,"tag":1117,"props":1151,"children":1152},{},[1153,1159],{"type":606,"tag":632,"props":1154,"children":1156},{"className":1155},[],[1157],{"type":612,"value":1158},"DELETE",{"type":612,"value":1160}," - Remove data",{"type":606,"tag":615,"props":1162,"children":1163},{},[1164],{"type":606,"tag":1107,"props":1165,"children":1166},{},[1167],{"type":612,"value":1168},"Common Response Formats:",{"type":606,"tag":1113,"props":1170,"children":1171},{},[1172,1177,1182,1187],{"type":606,"tag":1117,"props":1173,"children":1174},{},[1175],{"type":612,"value":1176},"JSON (most common)",{"type":606,"tag":1117,"props":1178,"children":1179},{},[1180],{"type":612,"value":1181},"XML",{"type":606,"tag":1117,"props":1183,"children":1184},{},[1185],{"type":612,"value":1186},"Plain text",{"type":606,"tag":1117,"props":1188,"children":1189},{},[1190],{"type":612,"value":1191},"CSV",{"type":606,"tag":615,"props":1193,"children":1194},{},[1195],{"type":606,"tag":1107,"props":1196,"children":1197},{},[1198],{"type":612,"value":1199},"Python Tools:",{"type":606,"tag":1113,"props":1201,"children":1202},{},[1203,1214,1225],{"type":606,"tag":1117,"props":1204,"children":1205},{},[1206,1212],{"type":606,"tag":632,"props":1207,"children":1209},{"className":1208},[],[1210],{"type":612,"value":1211},"urllib",{"type":612,"value":1213}," (built-in) - Basic HTTP requests",{"type":606,"tag":1117,"props":1215,"children":1216},{},[1217,1223],{"type":606,"tag":632,"props":1218,"children":1220},{"className":1219},[],[1221],{"type":612,"value":1222},"requests",{"type":612,"value":1224}," (third-party) - More user-friendly",{"type":606,"tag":1117,"props":1226,"children":1227},{},[1228,1234],{"type":606,"tag":632,"props":1229,"children":1231},{"className":1230},[],[1232],{"type":612,"value":1233},"json",{"type":612,"value":1235}," - Parse JSON responses",{"type":606,"tag":1237,"props":1238,"children":1240},"h3",{"id":1239},"basic-get-requests",[1241],{"type":612,"value":1242},"Basic GET Requests",{"type":606,"tag":621,"props":1244,"children":1245},{},[1246],{"type":606,"tag":625,"props":1247,"children":1249},{"className":627,"code":1248,"language":629,"meta":8,"style":8},"import urllib.request\nimport urllib.parse\nimport json\n\ndef fetch_user_posts(user_id):\n    \"\"\"Fetch posts for a specific user\"\"\"\n    base_url = \"https://jsonplaceholder.typicode.com/posts\"\n    params = {'userId': user_id}\n    \n    # Build URL with parameters\n    url = f\"{base_url}?{urllib.parse.urlencode(params)}\"\n    \n    try:\n        with urllib.request.urlopen(url) as response:\n            if response.status == 200:\n                data = json.loads(response.read())\n                return data\n            else:\n                print(f\"Error: HTTP {response.status}\")\n                return []\n    except Exception as e:\n        print(f\"Request failed: {e}\")\n        return []\n\ndef fetch_weather_data():\n    \"\"\"Simulate weather API call\"\"\"\n    # Mock weather data (replace with real API)\n    mock_data = {\n        \"temperature\": 22,\n        \"humidity\": 65,\n        \"conditions\": \"Partly Cloudy\",\n        \"location\": \"San Francisco\"\n    }\n    return mock_data\n\n# Test the functions\nposts = fetch_user_posts(1)\nprint(f\"Found {len(posts)} posts for user 1\")\nif posts:\n    print(f\"First post: {posts[0]['title']}\")\n\nweather = fetch_weather_data()\nprint(f\"Weather: {weather['temperature']}°C, {weather['conditions']}\")\n",[1250],{"type":606,"tag":632,"props":1251,"children":1252},{"__ignoreMap":8},[1253,1264,1276,1287,1294,1311,1319,1336,1363,1371,1379,1436,1443,1454,1473,1500,1517,1530,1542,1584,1596,1615,1655,1666,1673,1690,1698,1706,1723,1746,1767,1788,1805,1813,1826,1833,1841,1867,1911,1923,1982,1989,2006],{"type":606,"tag":636,"props":1254,"children":1255},{"class":638,"line":12},[1256,1260],{"type":606,"tag":636,"props":1257,"children":1258},{"style":642},[1259],{"type":612,"value":645},{"type":606,"tag":636,"props":1261,"children":1262},{"style":648},[1263],{"type":612,"value":651},{"type":606,"tag":636,"props":1265,"children":1266},{"class":638,"line":27},[1267,1271],{"type":606,"tag":636,"props":1268,"children":1269},{"style":642},[1270],{"type":612,"value":645},{"type":606,"tag":636,"props":1272,"children":1273},{"style":648},[1274],{"type":612,"value":1275}," urllib.parse\n",{"type":606,"tag":636,"props":1277,"children":1278},{"class":638,"line":36},[1279,1283],{"type":606,"tag":636,"props":1280,"children":1281},{"style":642},[1282],{"type":612,"value":645},{"type":606,"tag":636,"props":1284,"children":1285},{"style":648},[1286],{"type":612,"value":663},{"type":606,"tag":636,"props":1288,"children":1289},{"class":638,"line":45},[1290],{"type":606,"tag":636,"props":1291,"children":1292},{"emptyLinePlaceholder":13},[1293],{"type":612,"value":671},{"type":606,"tag":636,"props":1295,"children":1296},{"class":638,"line":54},[1297,1301,1306],{"type":606,"tag":636,"props":1298,"children":1299},{"style":642},[1300],{"type":612,"value":688},{"type":606,"tag":636,"props":1302,"children":1303},{"style":691},[1304],{"type":612,"value":1305}," fetch_user_posts",{"type":606,"tag":636,"props":1307,"children":1308},{"style":648},[1309],{"type":612,"value":1310},"(user_id):\n",{"type":606,"tag":636,"props":1312,"children":1313},{"class":638,"line":63},[1314],{"type":606,"tag":636,"props":1315,"children":1316},{"style":812},[1317],{"type":612,"value":1318},"    \"\"\"Fetch posts for a specific user\"\"\"\n",{"type":606,"tag":636,"props":1320,"children":1321},{"class":638,"line":72},[1322,1327,1331],{"type":606,"tag":636,"props":1323,"children":1324},{"style":648},[1325],{"type":612,"value":1326},"    base_url ",{"type":606,"tag":636,"props":1328,"children":1329},{"style":642},[1330],{"type":612,"value":748},{"type":606,"tag":636,"props":1332,"children":1333},{"style":812},[1334],{"type":612,"value":1335}," \"https://jsonplaceholder.typicode.com/posts\"\n",{"type":606,"tag":636,"props":1337,"children":1338},{"class":638,"line":81},[1339,1344,1348,1353,1358],{"type":606,"tag":636,"props":1340,"children":1341},{"style":648},[1342],{"type":612,"value":1343},"    params ",{"type":606,"tag":636,"props":1345,"children":1346},{"style":642},[1347],{"type":612,"value":748},{"type":606,"tag":636,"props":1349,"children":1350},{"style":648},[1351],{"type":612,"value":1352}," {",{"type":606,"tag":636,"props":1354,"children":1355},{"style":812},[1356],{"type":612,"value":1357},"'userId'",{"type":606,"tag":636,"props":1359,"children":1360},{"style":648},[1361],{"type":612,"value":1362},": user_id}\n",{"type":606,"tag":636,"props":1364,"children":1365},{"class":638,"line":756},[1366],{"type":606,"tag":636,"props":1367,"children":1368},{"style":648},[1369],{"type":612,"value":1370},"    \n",{"type":606,"tag":636,"props":1372,"children":1373},{"class":638,"line":99},[1374],{"type":606,"tag":636,"props":1375,"children":1376},{"style":677},[1377],{"type":612,"value":1378},"    # Build URL with parameters\n",{"type":606,"tag":636,"props":1380,"children":1381},{"class":638,"line":108},[1382,1387,1391,1396,1400,1404,1409,1413,1418,1422,1427,1431],{"type":606,"tag":636,"props":1383,"children":1384},{"style":648},[1385],{"type":612,"value":1386},"    url ",{"type":606,"tag":636,"props":1388,"children":1389},{"style":642},[1390],{"type":612,"value":748},{"type":606,"tag":636,"props":1392,"children":1393},{"style":642},[1394],{"type":612,"value":1395}," f",{"type":606,"tag":636,"props":1397,"children":1398},{"style":812},[1399],{"type":612,"value":835},{"type":606,"tag":636,"props":1401,"children":1402},{"style":778},[1403],{"type":612,"value":820},{"type":606,"tag":636,"props":1405,"children":1406},{"style":648},[1407],{"type":612,"value":1408},"base_url",{"type":606,"tag":636,"props":1410,"children":1411},{"style":778},[1412],{"type":612,"value":830},{"type":606,"tag":636,"props":1414,"children":1415},{"style":812},[1416],{"type":612,"value":1417},"?",{"type":606,"tag":636,"props":1419,"children":1420},{"style":778},[1421],{"type":612,"value":820},{"type":606,"tag":636,"props":1423,"children":1424},{"style":648},[1425],{"type":612,"value":1426},"urllib.parse.urlencode(params)",{"type":606,"tag":636,"props":1428,"children":1429},{"style":778},[1430],{"type":612,"value":830},{"type":606,"tag":636,"props":1432,"children":1433},{"style":812},[1434],{"type":612,"value":1435},"\"\n",{"type":606,"tag":636,"props":1437,"children":1438},{"class":638,"line":117},[1439],{"type":606,"tag":636,"props":1440,"children":1441},{"style":648},[1442],{"type":612,"value":1370},{"type":606,"tag":636,"props":1444,"children":1445},{"class":638,"line":126},[1446,1450],{"type":606,"tag":636,"props":1447,"children":1448},{"style":642},[1449],{"type":612,"value":707},{"type":606,"tag":636,"props":1451,"children":1452},{"style":648},[1453],{"type":612,"value":712},{"type":606,"tag":636,"props":1455,"children":1456},{"class":638,"line":135},[1457,1461,1465,1469],{"type":606,"tag":636,"props":1458,"children":1459},{"style":642},[1460],{"type":612,"value":720},{"type":606,"tag":636,"props":1462,"children":1463},{"style":648},[1464],{"type":612,"value":725},{"type":606,"tag":636,"props":1466,"children":1467},{"style":642},[1468],{"type":612,"value":730},{"type":606,"tag":636,"props":1470,"children":1471},{"style":648},[1472],{"type":612,"value":735},{"type":606,"tag":636,"props":1474,"children":1475},{"class":638,"line":144},[1476,1481,1486,1491,1496],{"type":606,"tag":636,"props":1477,"children":1478},{"style":642},[1479],{"type":612,"value":1480},"            if",{"type":606,"tag":636,"props":1482,"children":1483},{"style":648},[1484],{"type":612,"value":1485}," response.status ",{"type":606,"tag":636,"props":1487,"children":1488},{"style":642},[1489],{"type":612,"value":1490},"==",{"type":606,"tag":636,"props":1492,"children":1493},{"style":778},[1494],{"type":612,"value":1495}," 200",{"type":606,"tag":636,"props":1497,"children":1498},{"style":648},[1499],{"type":612,"value":712},{"type":606,"tag":636,"props":1501,"children":1502},{"class":638,"line":153},[1503,1508,1512],{"type":606,"tag":636,"props":1504,"children":1505},{"style":648},[1506],{"type":612,"value":1507},"                data ",{"type":606,"tag":636,"props":1509,"children":1510},{"style":642},[1511],{"type":612,"value":748},{"type":606,"tag":636,"props":1513,"children":1514},{"style":648},[1515],{"type":612,"value":1516}," json.loads(response.read())\n",{"type":606,"tag":636,"props":1518,"children":1519},{"class":638,"line":163},[1520,1525],{"type":606,"tag":636,"props":1521,"children":1522},{"style":642},[1523],{"type":612,"value":1524},"                return",{"type":606,"tag":636,"props":1526,"children":1527},{"style":648},[1528],{"type":612,"value":1529}," data\n",{"type":606,"tag":636,"props":1531,"children":1532},{"class":638,"line":172},[1533,1538],{"type":606,"tag":636,"props":1534,"children":1535},{"style":642},[1536],{"type":612,"value":1537},"            else",{"type":606,"tag":636,"props":1539,"children":1540},{"style":648},[1541],{"type":612,"value":712},{"type":606,"tag":636,"props":1543,"children":1544},{"class":638,"line":181},[1545,1550,1554,1558,1563,1567,1572,1576,1580],{"type":606,"tag":636,"props":1546,"children":1547},{"style":778},[1548],{"type":612,"value":1549},"                print",{"type":606,"tag":636,"props":1551,"children":1552},{"style":648},[1553],{"type":612,"value":804},{"type":606,"tag":636,"props":1555,"children":1556},{"style":642},[1557],{"type":612,"value":809},{"type":606,"tag":636,"props":1559,"children":1560},{"style":812},[1561],{"type":612,"value":1562},"\"Error: HTTP ",{"type":606,"tag":636,"props":1564,"children":1565},{"style":778},[1566],{"type":612,"value":820},{"type":606,"tag":636,"props":1568,"children":1569},{"style":648},[1570],{"type":612,"value":1571},"response.status",{"type":606,"tag":636,"props":1573,"children":1574},{"style":778},[1575],{"type":612,"value":830},{"type":606,"tag":636,"props":1577,"children":1578},{"style":812},[1579],{"type":612,"value":835},{"type":606,"tag":636,"props":1581,"children":1582},{"style":648},[1583],{"type":612,"value":840},{"type":606,"tag":636,"props":1585,"children":1586},{"class":638,"line":190},[1587,1591],{"type":606,"tag":636,"props":1588,"children":1589},{"style":642},[1590],{"type":612,"value":1524},{"type":606,"tag":636,"props":1592,"children":1593},{"style":648},[1594],{"type":612,"value":1595}," []\n",{"type":606,"tag":636,"props":1597,"children":1598},{"class":638,"line":199},[1599,1603,1607,1611],{"type":606,"tag":636,"props":1600,"children":1601},{"style":642},[1602],{"type":612,"value":775},{"type":606,"tag":636,"props":1604,"children":1605},{"style":778},[1606],{"type":612,"value":781},{"type":606,"tag":636,"props":1608,"children":1609},{"style":642},[1610],{"type":612,"value":786},{"type":606,"tag":636,"props":1612,"children":1613},{"style":648},[1614],{"type":612,"value":791},{"type":606,"tag":636,"props":1616,"children":1617},{"class":638,"line":208},[1618,1622,1626,1630,1635,1639,1643,1647,1651],{"type":606,"tag":636,"props":1619,"children":1620},{"style":778},[1621],{"type":612,"value":799},{"type":606,"tag":636,"props":1623,"children":1624},{"style":648},[1625],{"type":612,"value":804},{"type":606,"tag":636,"props":1627,"children":1628},{"style":642},[1629],{"type":612,"value":809},{"type":606,"tag":636,"props":1631,"children":1632},{"style":812},[1633],{"type":612,"value":1634},"\"Request failed: ",{"type":606,"tag":636,"props":1636,"children":1637},{"style":778},[1638],{"type":612,"value":820},{"type":606,"tag":636,"props":1640,"children":1641},{"style":648},[1642],{"type":612,"value":825},{"type":606,"tag":636,"props":1644,"children":1645},{"style":778},[1646],{"type":612,"value":830},{"type":606,"tag":636,"props":1648,"children":1649},{"style":812},[1650],{"type":612,"value":835},{"type":606,"tag":636,"props":1652,"children":1653},{"style":648},[1654],{"type":612,"value":840},{"type":606,"tag":636,"props":1656,"children":1657},{"class":638,"line":217},[1658,1662],{"type":606,"tag":636,"props":1659,"children":1660},{"style":642},[1661],{"type":612,"value":848},{"type":606,"tag":636,"props":1663,"children":1664},{"style":648},[1665],{"type":612,"value":1595},{"type":606,"tag":636,"props":1667,"children":1668},{"class":638,"line":227},[1669],{"type":606,"tag":636,"props":1670,"children":1671},{"emptyLinePlaceholder":13},[1672],{"type":612,"value":671},{"type":606,"tag":636,"props":1674,"children":1675},{"class":638,"line":236},[1676,1680,1685],{"type":606,"tag":636,"props":1677,"children":1678},{"style":642},[1679],{"type":612,"value":688},{"type":606,"tag":636,"props":1681,"children":1682},{"style":691},[1683],{"type":612,"value":1684}," fetch_weather_data",{"type":606,"tag":636,"props":1686,"children":1687},{"style":648},[1688],{"type":612,"value":1689},"():\n",{"type":606,"tag":636,"props":1691,"children":1692},{"class":638,"line":245},[1693],{"type":606,"tag":636,"props":1694,"children":1695},{"style":812},[1696],{"type":612,"value":1697},"    \"\"\"Simulate weather API call\"\"\"\n",{"type":606,"tag":636,"props":1699,"children":1700},{"class":638,"line":254},[1701],{"type":606,"tag":636,"props":1702,"children":1703},{"style":677},[1704],{"type":612,"value":1705},"    # Mock weather data (replace with real API)\n",{"type":606,"tag":636,"props":1707,"children":1708},{"class":638,"line":263},[1709,1714,1718],{"type":606,"tag":636,"props":1710,"children":1711},{"style":648},[1712],{"type":612,"value":1713},"    mock_data ",{"type":606,"tag":636,"props":1715,"children":1716},{"style":642},[1717],{"type":612,"value":748},{"type":606,"tag":636,"props":1719,"children":1720},{"style":648},[1721],{"type":612,"value":1722}," {\n",{"type":606,"tag":636,"props":1724,"children":1725},{"class":638,"line":272},[1726,1731,1736,1741],{"type":606,"tag":636,"props":1727,"children":1728},{"style":812},[1729],{"type":612,"value":1730},"        \"temperature\"",{"type":606,"tag":636,"props":1732,"children":1733},{"style":648},[1734],{"type":612,"value":1735},": ",{"type":606,"tag":636,"props":1737,"children":1738},{"style":778},[1739],{"type":612,"value":1740},"22",{"type":606,"tag":636,"props":1742,"children":1743},{"style":648},[1744],{"type":612,"value":1745},",\n",{"type":606,"tag":636,"props":1747,"children":1748},{"class":638,"line":281},[1749,1754,1758,1763],{"type":606,"tag":636,"props":1750,"children":1751},{"style":812},[1752],{"type":612,"value":1753},"        \"humidity\"",{"type":606,"tag":636,"props":1755,"children":1756},{"style":648},[1757],{"type":612,"value":1735},{"type":606,"tag":636,"props":1759,"children":1760},{"style":778},[1761],{"type":612,"value":1762},"65",{"type":606,"tag":636,"props":1764,"children":1765},{"style":648},[1766],{"type":612,"value":1745},{"type":606,"tag":636,"props":1768,"children":1769},{"class":638,"line":291},[1770,1775,1779,1784],{"type":606,"tag":636,"props":1771,"children":1772},{"style":812},[1773],{"type":612,"value":1774},"        \"conditions\"",{"type":606,"tag":636,"props":1776,"children":1777},{"style":648},[1778],{"type":612,"value":1735},{"type":606,"tag":636,"props":1780,"children":1781},{"style":812},[1782],{"type":612,"value":1783},"\"Partly Cloudy\"",{"type":606,"tag":636,"props":1785,"children":1786},{"style":648},[1787],{"type":612,"value":1745},{"type":606,"tag":636,"props":1789,"children":1790},{"class":638,"line":302},[1791,1796,1800],{"type":606,"tag":636,"props":1792,"children":1793},{"style":812},[1794],{"type":612,"value":1795},"        \"location\"",{"type":606,"tag":636,"props":1797,"children":1798},{"style":648},[1799],{"type":612,"value":1735},{"type":606,"tag":636,"props":1801,"children":1802},{"style":812},[1803],{"type":612,"value":1804},"\"San Francisco\"\n",{"type":606,"tag":636,"props":1806,"children":1807},{"class":638,"line":311},[1808],{"type":606,"tag":636,"props":1809,"children":1810},{"style":648},[1811],{"type":612,"value":1812},"    }\n",{"type":606,"tag":636,"props":1814,"children":1815},{"class":638,"line":320},[1816,1821],{"type":606,"tag":636,"props":1817,"children":1818},{"style":642},[1819],{"type":612,"value":1820},"    return",{"type":606,"tag":636,"props":1822,"children":1823},{"style":648},[1824],{"type":612,"value":1825}," mock_data\n",{"type":606,"tag":636,"props":1827,"children":1828},{"class":638,"line":329},[1829],{"type":606,"tag":636,"props":1830,"children":1831},{"emptyLinePlaceholder":13},[1832],{"type":612,"value":671},{"type":606,"tag":636,"props":1834,"children":1835},{"class":638,"line":338},[1836],{"type":606,"tag":636,"props":1837,"children":1838},{"style":677},[1839],{"type":612,"value":1840},"# Test the functions\n",{"type":606,"tag":636,"props":1842,"children":1843},{"class":638,"line":347},[1844,1849,1853,1858,1863],{"type":606,"tag":636,"props":1845,"children":1846},{"style":648},[1847],{"type":612,"value":1848},"posts ",{"type":606,"tag":636,"props":1850,"children":1851},{"style":642},[1852],{"type":612,"value":748},{"type":606,"tag":636,"props":1854,"children":1855},{"style":648},[1856],{"type":612,"value":1857}," fetch_user_posts(",{"type":606,"tag":636,"props":1859,"children":1860},{"style":778},[1861],{"type":612,"value":1862},"1",{"type":606,"tag":636,"props":1864,"children":1865},{"style":648},[1866],{"type":612,"value":840},{"type":606,"tag":636,"props":1868,"children":1869},{"class":638,"line":356},[1870,1875,1879,1883,1888,1893,1898,1902,1907],{"type":606,"tag":636,"props":1871,"children":1872},{"style":778},[1873],{"type":612,"value":1874},"print",{"type":606,"tag":636,"props":1876,"children":1877},{"style":648},[1878],{"type":612,"value":804},{"type":606,"tag":636,"props":1880,"children":1881},{"style":642},[1882],{"type":612,"value":809},{"type":606,"tag":636,"props":1884,"children":1885},{"style":812},[1886],{"type":612,"value":1887},"\"Found ",{"type":606,"tag":636,"props":1889,"children":1890},{"style":778},[1891],{"type":612,"value":1892},"{len",{"type":606,"tag":636,"props":1894,"children":1895},{"style":648},[1896],{"type":612,"value":1897},"(posts)",{"type":606,"tag":636,"props":1899,"children":1900},{"style":778},[1901],{"type":612,"value":830},{"type":606,"tag":636,"props":1903,"children":1904},{"style":812},[1905],{"type":612,"value":1906}," posts for user 1\"",{"type":606,"tag":636,"props":1908,"children":1909},{"style":648},[1910],{"type":612,"value":840},{"type":606,"tag":636,"props":1912,"children":1913},{"class":638,"line":367},[1914,1918],{"type":606,"tag":636,"props":1915,"children":1916},{"style":642},[1917],{"type":612,"value":917},{"type":606,"tag":636,"props":1919,"children":1920},{"style":648},[1921],{"type":612,"value":1922}," posts:\n",{"type":606,"tag":636,"props":1924,"children":1925},{"class":638,"line":376},[1926,1930,1934,1938,1943,1947,1952,1957,1962,1966,1970,1974,1978],{"type":606,"tag":636,"props":1927,"children":1928},{"style":778},[1929],{"type":612,"value":930},{"type":606,"tag":636,"props":1931,"children":1932},{"style":648},[1933],{"type":612,"value":804},{"type":606,"tag":636,"props":1935,"children":1936},{"style":642},[1937],{"type":612,"value":809},{"type":606,"tag":636,"props":1939,"children":1940},{"style":812},[1941],{"type":612,"value":1942},"\"First post: ",{"type":606,"tag":636,"props":1944,"children":1945},{"style":778},[1946],{"type":612,"value":820},{"type":606,"tag":636,"props":1948,"children":1949},{"style":648},[1950],{"type":612,"value":1951},"posts[",{"type":606,"tag":636,"props":1953,"children":1954},{"style":778},[1955],{"type":612,"value":1956},"0",{"type":606,"tag":636,"props":1958,"children":1959},{"style":648},[1960],{"type":612,"value":1961},"][",{"type":606,"tag":636,"props":1963,"children":1964},{"style":812},[1965],{"type":612,"value":1007},{"type":606,"tag":636,"props":1967,"children":1968},{"style":648},[1969],{"type":612,"value":962},{"type":606,"tag":636,"props":1971,"children":1972},{"style":778},[1973],{"type":612,"value":830},{"type":606,"tag":636,"props":1975,"children":1976},{"style":812},[1977],{"type":612,"value":835},{"type":606,"tag":636,"props":1979,"children":1980},{"style":648},[1981],{"type":612,"value":840},{"type":606,"tag":636,"props":1983,"children":1984},{"class":638,"line":385},[1985],{"type":606,"tag":636,"props":1986,"children":1987},{"emptyLinePlaceholder":13},[1988],{"type":612,"value":671},{"type":606,"tag":636,"props":1990,"children":1991},{"class":638,"line":394},[1992,1997,2001],{"type":606,"tag":636,"props":1993,"children":1994},{"style":648},[1995],{"type":612,"value":1996},"weather ",{"type":606,"tag":636,"props":1998,"children":1999},{"style":642},[2000],{"type":612,"value":748},{"type":606,"tag":636,"props":2002,"children":2003},{"style":648},[2004],{"type":612,"value":2005}," fetch_weather_data()\n",{"type":606,"tag":636,"props":2007,"children":2008},{"class":638,"line":403},[2009,2013,2017,2021,2026,2030,2035,2040,2044,2048,2053,2057,2061,2066,2070,2074,2078],{"type":606,"tag":636,"props":2010,"children":2011},{"style":778},[2012],{"type":612,"value":1874},{"type":606,"tag":636,"props":2014,"children":2015},{"style":648},[2016],{"type":612,"value":804},{"type":606,"tag":636,"props":2018,"children":2019},{"style":642},[2020],{"type":612,"value":809},{"type":606,"tag":636,"props":2022,"children":2023},{"style":812},[2024],{"type":612,"value":2025},"\"Weather: ",{"type":606,"tag":636,"props":2027,"children":2028},{"style":778},[2029],{"type":612,"value":820},{"type":606,"tag":636,"props":2031,"children":2032},{"style":648},[2033],{"type":612,"value":2034},"weather[",{"type":606,"tag":636,"props":2036,"children":2037},{"style":812},[2038],{"type":612,"value":2039},"'temperature'",{"type":606,"tag":636,"props":2041,"children":2042},{"style":648},[2043],{"type":612,"value":962},{"type":606,"tag":636,"props":2045,"children":2046},{"style":778},[2047],{"type":612,"value":830},{"type":606,"tag":636,"props":2049,"children":2050},{"style":812},[2051],{"type":612,"value":2052},"°C, ",{"type":606,"tag":636,"props":2054,"children":2055},{"style":778},[2056],{"type":612,"value":820},{"type":606,"tag":636,"props":2058,"children":2059},{"style":648},[2060],{"type":612,"value":2034},{"type":606,"tag":636,"props":2062,"children":2063},{"style":812},[2064],{"type":612,"value":2065},"'conditions'",{"type":606,"tag":636,"props":2067,"children":2068},{"style":648},[2069],{"type":612,"value":962},{"type":606,"tag":636,"props":2071,"children":2072},{"style":778},[2073],{"type":612,"value":830},{"type":606,"tag":636,"props":2075,"children":2076},{"style":812},[2077],{"type":612,"value":835},{"type":606,"tag":636,"props":2079,"children":2080},{"style":648},[2081],{"type":612,"value":840},{"type":606,"tag":1237,"props":2083,"children":2085},{"id":2084},"post-requests-with-data",[2086],{"type":612,"value":2087},"POST Requests with Data",{"type":606,"tag":621,"props":2089,"children":2090},{},[2091],{"type":606,"tag":625,"props":2092,"children":2094},{"className":627,"code":2093,"language":629,"meta":8,"style":8},"import urllib.request\nimport urllib.parse\nimport json\n\ndef create_post(title, body, user_id):\n    \"\"\"Create a new post via API\"\"\"\n    url = \"https://jsonplaceholder.typicode.com/posts\"\n    \n    # Prepare data\n    post_data = {\n        'title': title,\n        'body': body,\n        'userId': user_id\n    }\n    \n    # Convert to JSON and encode\n    json_data = json.dumps(post_data)\n    data = json_data.encode('utf-8')\n    \n    # Create request with headers\n    req = urllib.request.Request(url, data=data)\n    req.add_header('Content-Type', 'application/json')\n    \n    try:\n        with urllib.request.urlopen(req) as response:\n            if response.status == 201:  # Created\n                result = json.loads(response.read())\n                return result\n            else:\n                print(f\"Error: HTTP {response.status}\")\n                return None\n    except Exception as e:\n        print(f\"Request failed: {e}\")\n        return None\n\ndef send_form_data(name, email):\n    \"\"\"Send form data (application/x-www-form-urlencoded)\"\"\"\n    url = \"https://httpbin.org/post\"  # Test endpoint\n    \n    # Prepare form data\n    form_data = {\n        'name': name,\n        'email': email\n    }\n    \n    # Encode as form data\n    data = urllib.parse.urlencode(form_data).encode('utf-8')\n    \n    req = urllib.request.Request(url, data=data)\n    req.add_header('Content-Type', 'application/x-www-form-urlencoded')\n    \n    try:\n        with urllib.request.urlopen(req) as response:\n            result = json.loads(response.read())\n            return result.get('form', {})\n    except Exception as e:\n        print(f\"Form submission failed: {e}\")\n        return {}\n\n# Test POST request\nnew_post = create_post(\"My New Post\", \"This is the content of my post.\", 1)\nif new_post:\n    print(f\"Created post with ID: {new_post['id']}\")\n\n# Test form submission\nform_result = send_form_data(\"Alice Johnson\", \"alice@example.com\")\nprint(f\"Form submission result: {form_result}\")\n",[2095],{"type":606,"tag":632,"props":2096,"children":2097},{"__ignoreMap":8},[2098,2109,2120,2131,2138,2155,2163,2178,2185,2193,2209,2222,2235,2248,2255,2262,2270,2287,2313,2320,2328,2360,2387,2394,2405,2425,2455,2471,2483,2494,2533,2544,2563,2602,2613,2620,2637,2645,2666,2673,2681,2697,2710,2723,2730,2737,2745,2769,2776,2803,2827,2834,2845,2864,2880,2902,2921,2961,2973,2980,2988,3031,3043,3092,3100,3109,3145],{"type":606,"tag":636,"props":2099,"children":2100},{"class":638,"line":12},[2101,2105],{"type":606,"tag":636,"props":2102,"children":2103},{"style":642},[2104],{"type":612,"value":645},{"type":606,"tag":636,"props":2106,"children":2107},{"style":648},[2108],{"type":612,"value":651},{"type":606,"tag":636,"props":2110,"children":2111},{"class":638,"line":27},[2112,2116],{"type":606,"tag":636,"props":2113,"children":2114},{"style":642},[2115],{"type":612,"value":645},{"type":606,"tag":636,"props":2117,"children":2118},{"style":648},[2119],{"type":612,"value":1275},{"type":606,"tag":636,"props":2121,"children":2122},{"class":638,"line":36},[2123,2127],{"type":606,"tag":636,"props":2124,"children":2125},{"style":642},[2126],{"type":612,"value":645},{"type":606,"tag":636,"props":2128,"children":2129},{"style":648},[2130],{"type":612,"value":663},{"type":606,"tag":636,"props":2132,"children":2133},{"class":638,"line":45},[2134],{"type":606,"tag":636,"props":2135,"children":2136},{"emptyLinePlaceholder":13},[2137],{"type":612,"value":671},{"type":606,"tag":636,"props":2139,"children":2140},{"class":638,"line":54},[2141,2145,2150],{"type":606,"tag":636,"props":2142,"children":2143},{"style":642},[2144],{"type":612,"value":688},{"type":606,"tag":636,"props":2146,"children":2147},{"style":691},[2148],{"type":612,"value":2149}," create_post",{"type":606,"tag":636,"props":2151,"children":2152},{"style":648},[2153],{"type":612,"value":2154},"(title, body, user_id):\n",{"type":606,"tag":636,"props":2156,"children":2157},{"class":638,"line":63},[2158],{"type":606,"tag":636,"props":2159,"children":2160},{"style":812},[2161],{"type":612,"value":2162},"    \"\"\"Create a new post via API\"\"\"\n",{"type":606,"tag":636,"props":2164,"children":2165},{"class":638,"line":72},[2166,2170,2174],{"type":606,"tag":636,"props":2167,"children":2168},{"style":648},[2169],{"type":612,"value":1386},{"type":606,"tag":636,"props":2171,"children":2172},{"style":642},[2173],{"type":612,"value":748},{"type":606,"tag":636,"props":2175,"children":2176},{"style":812},[2177],{"type":612,"value":1335},{"type":606,"tag":636,"props":2179,"children":2180},{"class":638,"line":81},[2181],{"type":606,"tag":636,"props":2182,"children":2183},{"style":648},[2184],{"type":612,"value":1370},{"type":606,"tag":636,"props":2186,"children":2187},{"class":638,"line":756},[2188],{"type":606,"tag":636,"props":2189,"children":2190},{"style":677},[2191],{"type":612,"value":2192},"    # Prepare data\n",{"type":606,"tag":636,"props":2194,"children":2195},{"class":638,"line":99},[2196,2201,2205],{"type":606,"tag":636,"props":2197,"children":2198},{"style":648},[2199],{"type":612,"value":2200},"    post_data ",{"type":606,"tag":636,"props":2202,"children":2203},{"style":642},[2204],{"type":612,"value":748},{"type":606,"tag":636,"props":2206,"children":2207},{"style":648},[2208],{"type":612,"value":1722},{"type":606,"tag":636,"props":2210,"children":2211},{"class":638,"line":108},[2212,2217],{"type":606,"tag":636,"props":2213,"children":2214},{"style":812},[2215],{"type":612,"value":2216},"        'title'",{"type":606,"tag":636,"props":2218,"children":2219},{"style":648},[2220],{"type":612,"value":2221},": title,\n",{"type":606,"tag":636,"props":2223,"children":2224},{"class":638,"line":117},[2225,2230],{"type":606,"tag":636,"props":2226,"children":2227},{"style":812},[2228],{"type":612,"value":2229},"        'body'",{"type":606,"tag":636,"props":2231,"children":2232},{"style":648},[2233],{"type":612,"value":2234},": body,\n",{"type":606,"tag":636,"props":2236,"children":2237},{"class":638,"line":126},[2238,2243],{"type":606,"tag":636,"props":2239,"children":2240},{"style":812},[2241],{"type":612,"value":2242},"        'userId'",{"type":606,"tag":636,"props":2244,"children":2245},{"style":648},[2246],{"type":612,"value":2247},": user_id\n",{"type":606,"tag":636,"props":2249,"children":2250},{"class":638,"line":135},[2251],{"type":606,"tag":636,"props":2252,"children":2253},{"style":648},[2254],{"type":612,"value":1812},{"type":606,"tag":636,"props":2256,"children":2257},{"class":638,"line":144},[2258],{"type":606,"tag":636,"props":2259,"children":2260},{"style":648},[2261],{"type":612,"value":1370},{"type":606,"tag":636,"props":2263,"children":2264},{"class":638,"line":153},[2265],{"type":606,"tag":636,"props":2266,"children":2267},{"style":677},[2268],{"type":612,"value":2269},"    # Convert to JSON and encode\n",{"type":606,"tag":636,"props":2271,"children":2272},{"class":638,"line":163},[2273,2278,2282],{"type":606,"tag":636,"props":2274,"children":2275},{"style":648},[2276],{"type":612,"value":2277},"    json_data ",{"type":606,"tag":636,"props":2279,"children":2280},{"style":642},[2281],{"type":612,"value":748},{"type":606,"tag":636,"props":2283,"children":2284},{"style":648},[2285],{"type":612,"value":2286}," json.dumps(post_data)\n",{"type":606,"tag":636,"props":2288,"children":2289},{"class":638,"line":172},[2290,2295,2299,2304,2309],{"type":606,"tag":636,"props":2291,"children":2292},{"style":648},[2293],{"type":612,"value":2294},"    data ",{"type":606,"tag":636,"props":2296,"children":2297},{"style":642},[2298],{"type":612,"value":748},{"type":606,"tag":636,"props":2300,"children":2301},{"style":648},[2302],{"type":612,"value":2303}," json_data.encode(",{"type":606,"tag":636,"props":2305,"children":2306},{"style":812},[2307],{"type":612,"value":2308},"'utf-8'",{"type":606,"tag":636,"props":2310,"children":2311},{"style":648},[2312],{"type":612,"value":840},{"type":606,"tag":636,"props":2314,"children":2315},{"class":638,"line":181},[2316],{"type":606,"tag":636,"props":2317,"children":2318},{"style":648},[2319],{"type":612,"value":1370},{"type":606,"tag":636,"props":2321,"children":2322},{"class":638,"line":190},[2323],{"type":606,"tag":636,"props":2324,"children":2325},{"style":677},[2326],{"type":612,"value":2327},"    # Create request with headers\n",{"type":606,"tag":636,"props":2329,"children":2330},{"class":638,"line":199},[2331,2336,2340,2345,2351,2355],{"type":606,"tag":636,"props":2332,"children":2333},{"style":648},[2334],{"type":612,"value":2335},"    req ",{"type":606,"tag":636,"props":2337,"children":2338},{"style":642},[2339],{"type":612,"value":748},{"type":606,"tag":636,"props":2341,"children":2342},{"style":648},[2343],{"type":612,"value":2344}," urllib.request.Request(url, ",{"type":606,"tag":636,"props":2346,"children":2348},{"style":2347},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[2349],{"type":612,"value":2350},"data",{"type":606,"tag":636,"props":2352,"children":2353},{"style":642},[2354],{"type":612,"value":748},{"type":606,"tag":636,"props":2356,"children":2357},{"style":648},[2358],{"type":612,"value":2359},"data)\n",{"type":606,"tag":636,"props":2361,"children":2362},{"class":638,"line":208},[2363,2368,2373,2378,2383],{"type":606,"tag":636,"props":2364,"children":2365},{"style":648},[2366],{"type":612,"value":2367},"    req.add_header(",{"type":606,"tag":636,"props":2369,"children":2370},{"style":812},[2371],{"type":612,"value":2372},"'Content-Type'",{"type":606,"tag":636,"props":2374,"children":2375},{"style":648},[2376],{"type":612,"value":2377},", ",{"type":606,"tag":636,"props":2379,"children":2380},{"style":812},[2381],{"type":612,"value":2382},"'application/json'",{"type":606,"tag":636,"props":2384,"children":2385},{"style":648},[2386],{"type":612,"value":840},{"type":606,"tag":636,"props":2388,"children":2389},{"class":638,"line":217},[2390],{"type":606,"tag":636,"props":2391,"children":2392},{"style":648},[2393],{"type":612,"value":1370},{"type":606,"tag":636,"props":2395,"children":2396},{"class":638,"line":227},[2397,2401],{"type":606,"tag":636,"props":2398,"children":2399},{"style":642},[2400],{"type":612,"value":707},{"type":606,"tag":636,"props":2402,"children":2403},{"style":648},[2404],{"type":612,"value":712},{"type":606,"tag":636,"props":2406,"children":2407},{"class":638,"line":236},[2408,2412,2417,2421],{"type":606,"tag":636,"props":2409,"children":2410},{"style":642},[2411],{"type":612,"value":720},{"type":606,"tag":636,"props":2413,"children":2414},{"style":648},[2415],{"type":612,"value":2416}," urllib.request.urlopen(req) ",{"type":606,"tag":636,"props":2418,"children":2419},{"style":642},[2420],{"type":612,"value":730},{"type":606,"tag":636,"props":2422,"children":2423},{"style":648},[2424],{"type":612,"value":735},{"type":606,"tag":636,"props":2426,"children":2427},{"class":638,"line":245},[2428,2432,2436,2440,2445,2450],{"type":606,"tag":636,"props":2429,"children":2430},{"style":642},[2431],{"type":612,"value":1480},{"type":606,"tag":636,"props":2433,"children":2434},{"style":648},[2435],{"type":612,"value":1485},{"type":606,"tag":636,"props":2437,"children":2438},{"style":642},[2439],{"type":612,"value":1490},{"type":606,"tag":636,"props":2441,"children":2442},{"style":778},[2443],{"type":612,"value":2444}," 201",{"type":606,"tag":636,"props":2446,"children":2447},{"style":648},[2448],{"type":612,"value":2449},":  ",{"type":606,"tag":636,"props":2451,"children":2452},{"style":677},[2453],{"type":612,"value":2454},"# Created\n",{"type":606,"tag":636,"props":2456,"children":2457},{"class":638,"line":254},[2458,2463,2467],{"type":606,"tag":636,"props":2459,"children":2460},{"style":648},[2461],{"type":612,"value":2462},"                result ",{"type":606,"tag":636,"props":2464,"children":2465},{"style":642},[2466],{"type":612,"value":748},{"type":606,"tag":636,"props":2468,"children":2469},{"style":648},[2470],{"type":612,"value":1516},{"type":606,"tag":636,"props":2472,"children":2473},{"class":638,"line":263},[2474,2478],{"type":606,"tag":636,"props":2475,"children":2476},{"style":642},[2477],{"type":612,"value":1524},{"type":606,"tag":636,"props":2479,"children":2480},{"style":648},[2481],{"type":612,"value":2482}," result\n",{"type":606,"tag":636,"props":2484,"children":2485},{"class":638,"line":272},[2486,2490],{"type":606,"tag":636,"props":2487,"children":2488},{"style":642},[2489],{"type":612,"value":1537},{"type":606,"tag":636,"props":2491,"children":2492},{"style":648},[2493],{"type":612,"value":712},{"type":606,"tag":636,"props":2495,"children":2496},{"class":638,"line":281},[2497,2501,2505,2509,2513,2517,2521,2525,2529],{"type":606,"tag":636,"props":2498,"children":2499},{"style":778},[2500],{"type":612,"value":1549},{"type":606,"tag":636,"props":2502,"children":2503},{"style":648},[2504],{"type":612,"value":804},{"type":606,"tag":636,"props":2506,"children":2507},{"style":642},[2508],{"type":612,"value":809},{"type":606,"tag":636,"props":2510,"children":2511},{"style":812},[2512],{"type":612,"value":1562},{"type":606,"tag":636,"props":2514,"children":2515},{"style":778},[2516],{"type":612,"value":820},{"type":606,"tag":636,"props":2518,"children":2519},{"style":648},[2520],{"type":612,"value":1571},{"type":606,"tag":636,"props":2522,"children":2523},{"style":778},[2524],{"type":612,"value":830},{"type":606,"tag":636,"props":2526,"children":2527},{"style":812},[2528],{"type":612,"value":835},{"type":606,"tag":636,"props":2530,"children":2531},{"style":648},[2532],{"type":612,"value":840},{"type":606,"tag":636,"props":2534,"children":2535},{"class":638,"line":291},[2536,2540],{"type":606,"tag":636,"props":2537,"children":2538},{"style":642},[2539],{"type":612,"value":1524},{"type":606,"tag":636,"props":2541,"children":2542},{"style":778},[2543],{"type":612,"value":853},{"type":606,"tag":636,"props":2545,"children":2546},{"class":638,"line":302},[2547,2551,2555,2559],{"type":606,"tag":636,"props":2548,"children":2549},{"style":642},[2550],{"type":612,"value":775},{"type":606,"tag":636,"props":2552,"children":2553},{"style":778},[2554],{"type":612,"value":781},{"type":606,"tag":636,"props":2556,"children":2557},{"style":642},[2558],{"type":612,"value":786},{"type":606,"tag":636,"props":2560,"children":2561},{"style":648},[2562],{"type":612,"value":791},{"type":606,"tag":636,"props":2564,"children":2565},{"class":638,"line":311},[2566,2570,2574,2578,2582,2586,2590,2594,2598],{"type":606,"tag":636,"props":2567,"children":2568},{"style":778},[2569],{"type":612,"value":799},{"type":606,"tag":636,"props":2571,"children":2572},{"style":648},[2573],{"type":612,"value":804},{"type":606,"tag":636,"props":2575,"children":2576},{"style":642},[2577],{"type":612,"value":809},{"type":606,"tag":636,"props":2579,"children":2580},{"style":812},[2581],{"type":612,"value":1634},{"type":606,"tag":636,"props":2583,"children":2584},{"style":778},[2585],{"type":612,"value":820},{"type":606,"tag":636,"props":2587,"children":2588},{"style":648},[2589],{"type":612,"value":825},{"type":606,"tag":636,"props":2591,"children":2592},{"style":778},[2593],{"type":612,"value":830},{"type":606,"tag":636,"props":2595,"children":2596},{"style":812},[2597],{"type":612,"value":835},{"type":606,"tag":636,"props":2599,"children":2600},{"style":648},[2601],{"type":612,"value":840},{"type":606,"tag":636,"props":2603,"children":2604},{"class":638,"line":320},[2605,2609],{"type":606,"tag":636,"props":2606,"children":2607},{"style":642},[2608],{"type":612,"value":848},{"type":606,"tag":636,"props":2610,"children":2611},{"style":778},[2612],{"type":612,"value":853},{"type":606,"tag":636,"props":2614,"children":2615},{"class":638,"line":329},[2616],{"type":606,"tag":636,"props":2617,"children":2618},{"emptyLinePlaceholder":13},[2619],{"type":612,"value":671},{"type":606,"tag":636,"props":2621,"children":2622},{"class":638,"line":338},[2623,2627,2632],{"type":606,"tag":636,"props":2624,"children":2625},{"style":642},[2626],{"type":612,"value":688},{"type":606,"tag":636,"props":2628,"children":2629},{"style":691},[2630],{"type":612,"value":2631}," send_form_data",{"type":606,"tag":636,"props":2633,"children":2634},{"style":648},[2635],{"type":612,"value":2636},"(name, email):\n",{"type":606,"tag":636,"props":2638,"children":2639},{"class":638,"line":347},[2640],{"type":606,"tag":636,"props":2641,"children":2642},{"style":812},[2643],{"type":612,"value":2644},"    \"\"\"Send form data (application/x-www-form-urlencoded)\"\"\"\n",{"type":606,"tag":636,"props":2646,"children":2647},{"class":638,"line":356},[2648,2652,2656,2661],{"type":606,"tag":636,"props":2649,"children":2650},{"style":648},[2651],{"type":612,"value":1386},{"type":606,"tag":636,"props":2653,"children":2654},{"style":642},[2655],{"type":612,"value":748},{"type":606,"tag":636,"props":2657,"children":2658},{"style":812},[2659],{"type":612,"value":2660}," \"https://httpbin.org/post\"",{"type":606,"tag":636,"props":2662,"children":2663},{"style":677},[2664],{"type":612,"value":2665},"  # Test endpoint\n",{"type":606,"tag":636,"props":2667,"children":2668},{"class":638,"line":367},[2669],{"type":606,"tag":636,"props":2670,"children":2671},{"style":648},[2672],{"type":612,"value":1370},{"type":606,"tag":636,"props":2674,"children":2675},{"class":638,"line":376},[2676],{"type":606,"tag":636,"props":2677,"children":2678},{"style":677},[2679],{"type":612,"value":2680},"    # Prepare form data\n",{"type":606,"tag":636,"props":2682,"children":2683},{"class":638,"line":385},[2684,2689,2693],{"type":606,"tag":636,"props":2685,"children":2686},{"style":648},[2687],{"type":612,"value":2688},"    form_data ",{"type":606,"tag":636,"props":2690,"children":2691},{"style":642},[2692],{"type":612,"value":748},{"type":606,"tag":636,"props":2694,"children":2695},{"style":648},[2696],{"type":612,"value":1722},{"type":606,"tag":636,"props":2698,"children":2699},{"class":638,"line":394},[2700,2705],{"type":606,"tag":636,"props":2701,"children":2702},{"style":812},[2703],{"type":612,"value":2704},"        'name'",{"type":606,"tag":636,"props":2706,"children":2707},{"style":648},[2708],{"type":612,"value":2709},": name,\n",{"type":606,"tag":636,"props":2711,"children":2712},{"class":638,"line":403},[2713,2718],{"type":606,"tag":636,"props":2714,"children":2715},{"style":812},[2716],{"type":612,"value":2717},"        'email'",{"type":606,"tag":636,"props":2719,"children":2720},{"style":648},[2721],{"type":612,"value":2722},": email\n",{"type":606,"tag":636,"props":2724,"children":2725},{"class":638,"line":412},[2726],{"type":606,"tag":636,"props":2727,"children":2728},{"style":648},[2729],{"type":612,"value":1812},{"type":606,"tag":636,"props":2731,"children":2732},{"class":638,"line":423},[2733],{"type":606,"tag":636,"props":2734,"children":2735},{"style":648},[2736],{"type":612,"value":1370},{"type":606,"tag":636,"props":2738,"children":2739},{"class":638,"line":432},[2740],{"type":606,"tag":636,"props":2741,"children":2742},{"style":677},[2743],{"type":612,"value":2744},"    # Encode as form data\n",{"type":606,"tag":636,"props":2746,"children":2747},{"class":638,"line":441},[2748,2752,2756,2761,2765],{"type":606,"tag":636,"props":2749,"children":2750},{"style":648},[2751],{"type":612,"value":2294},{"type":606,"tag":636,"props":2753,"children":2754},{"style":642},[2755],{"type":612,"value":748},{"type":606,"tag":636,"props":2757,"children":2758},{"style":648},[2759],{"type":612,"value":2760}," urllib.parse.urlencode(form_data).encode(",{"type":606,"tag":636,"props":2762,"children":2763},{"style":812},[2764],{"type":612,"value":2308},{"type":606,"tag":636,"props":2766,"children":2767},{"style":648},[2768],{"type":612,"value":840},{"type":606,"tag":636,"props":2770,"children":2771},{"class":638,"line":450},[2772],{"type":606,"tag":636,"props":2773,"children":2774},{"style":648},[2775],{"type":612,"value":1370},{"type":606,"tag":636,"props":2777,"children":2778},{"class":638,"line":459},[2779,2783,2787,2791,2795,2799],{"type":606,"tag":636,"props":2780,"children":2781},{"style":648},[2782],{"type":612,"value":2335},{"type":606,"tag":636,"props":2784,"children":2785},{"style":642},[2786],{"type":612,"value":748},{"type":606,"tag":636,"props":2788,"children":2789},{"style":648},[2790],{"type":612,"value":2344},{"type":606,"tag":636,"props":2792,"children":2793},{"style":2347},[2794],{"type":612,"value":2350},{"type":606,"tag":636,"props":2796,"children":2797},{"style":642},[2798],{"type":612,"value":748},{"type":606,"tag":636,"props":2800,"children":2801},{"style":648},[2802],{"type":612,"value":2359},{"type":606,"tag":636,"props":2804,"children":2805},{"class":638,"line":468},[2806,2810,2814,2818,2823],{"type":606,"tag":636,"props":2807,"children":2808},{"style":648},[2809],{"type":612,"value":2367},{"type":606,"tag":636,"props":2811,"children":2812},{"style":812},[2813],{"type":612,"value":2372},{"type":606,"tag":636,"props":2815,"children":2816},{"style":648},[2817],{"type":612,"value":2377},{"type":606,"tag":636,"props":2819,"children":2820},{"style":812},[2821],{"type":612,"value":2822},"'application/x-www-form-urlencoded'",{"type":606,"tag":636,"props":2824,"children":2825},{"style":648},[2826],{"type":612,"value":840},{"type":606,"tag":636,"props":2828,"children":2829},{"class":638,"line":477},[2830],{"type":606,"tag":636,"props":2831,"children":2832},{"style":648},[2833],{"type":612,"value":1370},{"type":606,"tag":636,"props":2835,"children":2836},{"class":638,"line":488},[2837,2841],{"type":606,"tag":636,"props":2838,"children":2839},{"style":642},[2840],{"type":612,"value":707},{"type":606,"tag":636,"props":2842,"children":2843},{"style":648},[2844],{"type":612,"value":712},{"type":606,"tag":636,"props":2846,"children":2847},{"class":638,"line":497},[2848,2852,2856,2860],{"type":606,"tag":636,"props":2849,"children":2850},{"style":642},[2851],{"type":612,"value":720},{"type":606,"tag":636,"props":2853,"children":2854},{"style":648},[2855],{"type":612,"value":2416},{"type":606,"tag":636,"props":2857,"children":2858},{"style":642},[2859],{"type":612,"value":730},{"type":606,"tag":636,"props":2861,"children":2862},{"style":648},[2863],{"type":612,"value":735},{"type":606,"tag":636,"props":2865,"children":2866},{"class":638,"line":506},[2867,2872,2876],{"type":606,"tag":636,"props":2868,"children":2869},{"style":648},[2870],{"type":612,"value":2871},"            result ",{"type":606,"tag":636,"props":2873,"children":2874},{"style":642},[2875],{"type":612,"value":748},{"type":606,"tag":636,"props":2877,"children":2878},{"style":648},[2879],{"type":612,"value":1516},{"type":606,"tag":636,"props":2881,"children":2882},{"class":638,"line":515},[2883,2887,2892,2897],{"type":606,"tag":636,"props":2884,"children":2885},{"style":642},[2886],{"type":612,"value":762},{"type":606,"tag":636,"props":2888,"children":2889},{"style":648},[2890],{"type":612,"value":2891}," result.get(",{"type":606,"tag":636,"props":2893,"children":2894},{"style":812},[2895],{"type":612,"value":2896},"'form'",{"type":606,"tag":636,"props":2898,"children":2899},{"style":648},[2900],{"type":612,"value":2901},", {})\n",{"type":606,"tag":636,"props":2903,"children":2904},{"class":638,"line":524},[2905,2909,2913,2917],{"type":606,"tag":636,"props":2906,"children":2907},{"style":642},[2908],{"type":612,"value":775},{"type":606,"tag":636,"props":2910,"children":2911},{"style":778},[2912],{"type":612,"value":781},{"type":606,"tag":636,"props":2914,"children":2915},{"style":642},[2916],{"type":612,"value":786},{"type":606,"tag":636,"props":2918,"children":2919},{"style":648},[2920],{"type":612,"value":791},{"type":606,"tag":636,"props":2922,"children":2923},{"class":638,"line":533},[2924,2928,2932,2936,2941,2945,2949,2953,2957],{"type":606,"tag":636,"props":2925,"children":2926},{"style":778},[2927],{"type":612,"value":799},{"type":606,"tag":636,"props":2929,"children":2930},{"style":648},[2931],{"type":612,"value":804},{"type":606,"tag":636,"props":2933,"children":2934},{"style":642},[2935],{"type":612,"value":809},{"type":606,"tag":636,"props":2937,"children":2938},{"style":812},[2939],{"type":612,"value":2940},"\"Form submission failed: ",{"type":606,"tag":636,"props":2942,"children":2943},{"style":778},[2944],{"type":612,"value":820},{"type":606,"tag":636,"props":2946,"children":2947},{"style":648},[2948],{"type":612,"value":825},{"type":606,"tag":636,"props":2950,"children":2951},{"style":778},[2952],{"type":612,"value":830},{"type":606,"tag":636,"props":2954,"children":2955},{"style":812},[2956],{"type":612,"value":835},{"type":606,"tag":636,"props":2958,"children":2959},{"style":648},[2960],{"type":612,"value":840},{"type":606,"tag":636,"props":2962,"children":2963},{"class":638,"line":544},[2964,2968],{"type":606,"tag":636,"props":2965,"children":2966},{"style":642},[2967],{"type":612,"value":848},{"type":606,"tag":636,"props":2969,"children":2970},{"style":648},[2971],{"type":612,"value":2972}," {}\n",{"type":606,"tag":636,"props":2974,"children":2975},{"class":638,"line":553},[2976],{"type":606,"tag":636,"props":2977,"children":2978},{"emptyLinePlaceholder":13},[2979],{"type":612,"value":671},{"type":606,"tag":636,"props":2981,"children":2982},{"class":638,"line":562},[2983],{"type":606,"tag":636,"props":2984,"children":2985},{"style":677},[2986],{"type":612,"value":2987},"# Test POST request\n",{"type":606,"tag":636,"props":2989,"children":2990},{"class":638,"line":571},[2991,2996,3000,3005,3010,3014,3019,3023,3027],{"type":606,"tag":636,"props":2992,"children":2993},{"style":648},[2994],{"type":612,"value":2995},"new_post ",{"type":606,"tag":636,"props":2997,"children":2998},{"style":642},[2999],{"type":612,"value":748},{"type":606,"tag":636,"props":3001,"children":3002},{"style":648},[3003],{"type":612,"value":3004}," create_post(",{"type":606,"tag":636,"props":3006,"children":3007},{"style":812},[3008],{"type":612,"value":3009},"\"My New Post\"",{"type":606,"tag":636,"props":3011,"children":3012},{"style":648},[3013],{"type":612,"value":2377},{"type":606,"tag":636,"props":3015,"children":3016},{"style":812},[3017],{"type":612,"value":3018},"\"This is the content of my post.\"",{"type":606,"tag":636,"props":3020,"children":3021},{"style":648},[3022],{"type":612,"value":2377},{"type":606,"tag":636,"props":3024,"children":3025},{"style":778},[3026],{"type":612,"value":1862},{"type":606,"tag":636,"props":3028,"children":3029},{"style":648},[3030],{"type":612,"value":840},{"type":606,"tag":636,"props":3032,"children":3033},{"class":638,"line":580},[3034,3038],{"type":606,"tag":636,"props":3035,"children":3036},{"style":642},[3037],{"type":612,"value":917},{"type":606,"tag":636,"props":3039,"children":3040},{"style":648},[3041],{"type":612,"value":3042}," new_post:\n",{"type":606,"tag":636,"props":3044,"children":3045},{"class":638,"line":589},[3046,3050,3054,3058,3063,3067,3072,3076,3080,3084,3088],{"type":606,"tag":636,"props":3047,"children":3048},{"style":778},[3049],{"type":612,"value":930},{"type":606,"tag":636,"props":3051,"children":3052},{"style":648},[3053],{"type":612,"value":804},{"type":606,"tag":636,"props":3055,"children":3056},{"style":642},[3057],{"type":612,"value":809},{"type":606,"tag":636,"props":3059,"children":3060},{"style":812},[3061],{"type":612,"value":3062},"\"Created post with ID: ",{"type":606,"tag":636,"props":3064,"children":3065},{"style":778},[3066],{"type":612,"value":820},{"type":606,"tag":636,"props":3068,"children":3069},{"style":648},[3070],{"type":612,"value":3071},"new_post[",{"type":606,"tag":636,"props":3073,"children":3074},{"style":812},[3075],{"type":612,"value":957},{"type":606,"tag":636,"props":3077,"children":3078},{"style":648},[3079],{"type":612,"value":962},{"type":606,"tag":636,"props":3081,"children":3082},{"style":778},[3083],{"type":612,"value":830},{"type":606,"tag":636,"props":3085,"children":3086},{"style":812},[3087],{"type":612,"value":835},{"type":606,"tag":636,"props":3089,"children":3090},{"style":648},[3091],{"type":612,"value":840},{"type":606,"tag":636,"props":3093,"children":3095},{"class":638,"line":3094},64,[3096],{"type":606,"tag":636,"props":3097,"children":3098},{"emptyLinePlaceholder":13},[3099],{"type":612,"value":671},{"type":606,"tag":636,"props":3101,"children":3103},{"class":638,"line":3102},65,[3104],{"type":606,"tag":636,"props":3105,"children":3106},{"style":677},[3107],{"type":612,"value":3108},"# Test form submission\n",{"type":606,"tag":636,"props":3110,"children":3112},{"class":638,"line":3111},66,[3113,3118,3122,3127,3132,3136,3141],{"type":606,"tag":636,"props":3114,"children":3115},{"style":648},[3116],{"type":612,"value":3117},"form_result ",{"type":606,"tag":636,"props":3119,"children":3120},{"style":642},[3121],{"type":612,"value":748},{"type":606,"tag":636,"props":3123,"children":3124},{"style":648},[3125],{"type":612,"value":3126}," send_form_data(",{"type":606,"tag":636,"props":3128,"children":3129},{"style":812},[3130],{"type":612,"value":3131},"\"Alice Johnson\"",{"type":606,"tag":636,"props":3133,"children":3134},{"style":648},[3135],{"type":612,"value":2377},{"type":606,"tag":636,"props":3137,"children":3138},{"style":812},[3139],{"type":612,"value":3140},"\"alice@example.com\"",{"type":606,"tag":636,"props":3142,"children":3143},{"style":648},[3144],{"type":612,"value":840},{"type":606,"tag":636,"props":3146,"children":3148},{"class":638,"line":3147},67,[3149,3153,3157,3161,3166,3170,3175,3179,3183],{"type":606,"tag":636,"props":3150,"children":3151},{"style":778},[3152],{"type":612,"value":1874},{"type":606,"tag":636,"props":3154,"children":3155},{"style":648},[3156],{"type":612,"value":804},{"type":606,"tag":636,"props":3158,"children":3159},{"style":642},[3160],{"type":612,"value":809},{"type":606,"tag":636,"props":3162,"children":3163},{"style":812},[3164],{"type":612,"value":3165},"\"Form submission result: ",{"type":606,"tag":636,"props":3167,"children":3168},{"style":778},[3169],{"type":612,"value":820},{"type":606,"tag":636,"props":3171,"children":3172},{"style":648},[3173],{"type":612,"value":3174},"form_result",{"type":606,"tag":636,"props":3176,"children":3177},{"style":778},[3178],{"type":612,"value":830},{"type":606,"tag":636,"props":3180,"children":3181},{"style":812},[3182],{"type":612,"value":835},{"type":606,"tag":636,"props":3184,"children":3185},{"style":648},[3186],{"type":612,"value":840},{"type":606,"tag":1085,"props":3188,"children":3190},{"id":3189},"http-status-codes-reference",[3191],{"type":612,"value":3192},"📋 HTTP Status Codes Reference",{"type":606,"tag":3194,"props":3195,"children":3196},"table",{},[3197,3221],{"type":606,"tag":3198,"props":3199,"children":3200},"thead",{},[3201],{"type":606,"tag":3202,"props":3203,"children":3204},"tr",{},[3205,3211,3216],{"type":606,"tag":3206,"props":3207,"children":3208},"th",{},[3209],{"type":612,"value":3210},"Code",{"type":606,"tag":3206,"props":3212,"children":3213},{},[3214],{"type":612,"value":3215},"Meaning",{"type":606,"tag":3206,"props":3217,"children":3218},{},[3219],{"type":612,"value":3220},"Description",{"type":606,"tag":3222,"props":3223,"children":3224},"tbody",{},[3225,3244,3262,3280,3298,3316],{"type":606,"tag":3202,"props":3226,"children":3227},{},[3228,3234,3239],{"type":606,"tag":3229,"props":3230,"children":3231},"td",{},[3232],{"type":612,"value":3233},"200",{"type":606,"tag":3229,"props":3235,"children":3236},{},[3237],{"type":612,"value":3238},"OK",{"type":606,"tag":3229,"props":3240,"children":3241},{},[3242],{"type":612,"value":3243},"Request successful",{"type":606,"tag":3202,"props":3245,"children":3246},{},[3247,3252,3257],{"type":606,"tag":3229,"props":3248,"children":3249},{},[3250],{"type":612,"value":3251},"201",{"type":606,"tag":3229,"props":3253,"children":3254},{},[3255],{"type":612,"value":3256},"Created",{"type":606,"tag":3229,"props":3258,"children":3259},{},[3260],{"type":612,"value":3261},"Resource created successfully",{"type":606,"tag":3202,"props":3263,"children":3264},{},[3265,3270,3275],{"type":606,"tag":3229,"props":3266,"children":3267},{},[3268],{"type":612,"value":3269},"400",{"type":606,"tag":3229,"props":3271,"children":3272},{},[3273],{"type":612,"value":3274},"Bad Request",{"type":606,"tag":3229,"props":3276,"children":3277},{},[3278],{"type":612,"value":3279},"Invalid request format",{"type":606,"tag":3202,"props":3281,"children":3282},{},[3283,3288,3293],{"type":606,"tag":3229,"props":3284,"children":3285},{},[3286],{"type":612,"value":3287},"401",{"type":606,"tag":3229,"props":3289,"children":3290},{},[3291],{"type":612,"value":3292},"Unauthorized",{"type":606,"tag":3229,"props":3294,"children":3295},{},[3296],{"type":612,"value":3297},"Authentication required",{"type":606,"tag":3202,"props":3299,"children":3300},{},[3301,3306,3311],{"type":606,"tag":3229,"props":3302,"children":3303},{},[3304],{"type":612,"value":3305},"404",{"type":606,"tag":3229,"props":3307,"children":3308},{},[3309],{"type":612,"value":3310},"Not Found",{"type":606,"tag":3229,"props":3312,"children":3313},{},[3314],{"type":612,"value":3315},"Resource doesn't exist",{"type":606,"tag":3202,"props":3317,"children":3318},{},[3319,3324,3329],{"type":606,"tag":3229,"props":3320,"children":3321},{},[3322],{"type":612,"value":3323},"500",{"type":606,"tag":3229,"props":3325,"children":3326},{},[3327],{"type":612,"value":3328},"Server Error",{"type":606,"tag":3229,"props":3330,"children":3331},{},[3332],{"type":612,"value":3333},"Internal server error",{"type":606,"tag":1085,"props":3335,"children":3337},{"id":3336},"error-handling-and-retries",[3338],{"type":612,"value":3339},"🔧 Error Handling and Retries",{"type":606,"tag":1237,"props":3341,"children":3343},{"id":3342},"robust-api-request-handler",[3344],{"type":612,"value":3345},"Robust API Request Handler",{"type":606,"tag":621,"props":3347,"children":3348},{},[3349],{"type":606,"tag":625,"props":3350,"children":3352},{"className":627,"code":3351,"language":629,"meta":8,"style":8},"import urllib.request\nimport urllib.error\nimport json\nimport time\n\ndef api_request_with_retry(url, method='GET', data=None, headers=None, max_retries=3):\n    \"\"\"Make API request with retry logic and error handling\"\"\"\n    \n    if headers is None:\n        headers = {}\n    \n    # Set default headers\n    if 'User-Agent' not in headers:\n        headers['User-Agent'] = 'Python API Client 1.0'\n    \n    for attempt in range(max_retries):\n        try:\n            # Create request\n            req = urllib.request.Request(url, data=data, headers=headers, method=method)\n            \n            with urllib.request.urlopen(req, timeout=10) as response:\n                status_code = response.status\n                response_data = response.read()\n                \n                # Parse JSON if content type indicates JSON\n                content_type = response.headers.get('Content-Type', '')\n                if 'application/json' in content_type:\n                    try:\n                        parsed_data = json.loads(response_data)\n                    except json.JSONDecodeError:\n                        parsed_data = response_data.decode('utf-8')\n                else:\n                    parsed_data = response_data.decode('utf-8')\n                \n                return {\n                    'success': True,\n                    'status_code': status_code,\n                    'data': parsed_data,\n                    'headers': dict(response.headers)\n                }\n                \n        except urllib.error.HTTPError as e:\n            status_code = e.code\n            error_msg = f\"HTTP {status_code}: {e.reason}\"\n            \n            if status_code >= 500 and attempt \u003C max_retries - 1:\n                # Retry on server errors\n                print(f\"Server error, retrying in {2 ** attempt} seconds...\")\n                time.sleep(2 ** attempt)\n                continue\n            else:\n                return {\n                    'success': False,\n                    'status_code': status_code,\n                    'error': error_msg\n                }\n                \n        except urllib.error.URLError as e:\n            error_msg = f\"Network error: {e.reason}\"\n            if attempt \u003C max_retries - 1:\n                print(f\"Network error, retrying in {2 ** attempt} seconds...\")\n                time.sleep(2 ** attempt)\n                continue\n            else:\n                return {\n                    'success': False,\n                    'error': error_msg\n                }\n        \n        except Exception as e:\n            return {\n                'success': False,\n                'error': f\"Unexpected error: {str(e)}\"\n            }\n    \n    return {\n        'success': False,\n        'error': f\"Max retries ({max_retries}) exceeded\"\n    }\n\n# Test robust API handler\ndef test_api_endpoints():\n    \"\"\"Test various API scenarios\"\"\"\n    \n    # Test successful request\n    result = api_request_with_retry(\"https://jsonplaceholder.typicode.com/posts/1\")\n    if result['success']:\n        print(f\"Success: Got post with title: {result['data']['title']}\")\n    else:\n        print(f\"Failed: {result['error']}\")\n    \n    # Test 404 error\n    result = api_request_with_retry(\"https://jsonplaceholder.typicode.com/posts/99999\")\n    if result['success']:\n        print(\"Success: Found post\")\n    else:\n        print(f\"Expected 404: {result['error']}\")\n\ntest_api_endpoints()\n",[3353],{"type":606,"tag":632,"props":3354,"children":3355},{"__ignoreMap":8},[3356,3367,3379,3390,3402,3409,3481,3489,3496,3523,3539,3546,3554,3581,3608,3615,3643,3655,3663,3720,3728,3768,3785,3801,3809,3817,3851,3873,3885,3902,3915,3939,3951,3975,3982,3993,4014,4027,4040,4062,4070,4077,4098,4115,4170,4177,4232,4240,4288,4310,4318,4329,4340,4360,4371,4384,4391,4398,4418,4454,4485,4529,4548,4555,4566,4577,4596,4607,4615,4624,4644,4656,4677,4717,4726,4734,4746,4767,4807,4815,4823,4832,4849,4858,4866,4875,4902,4925,4984,4997,5047,5055,5064,5089,5109,5130,5142,5191,5199],{"type":606,"tag":636,"props":3357,"children":3358},{"class":638,"line":12},[3359,3363],{"type":606,"tag":636,"props":3360,"children":3361},{"style":642},[3362],{"type":612,"value":645},{"type":606,"tag":636,"props":3364,"children":3365},{"style":648},[3366],{"type":612,"value":651},{"type":606,"tag":636,"props":3368,"children":3369},{"class":638,"line":27},[3370,3374],{"type":606,"tag":636,"props":3371,"children":3372},{"style":642},[3373],{"type":612,"value":645},{"type":606,"tag":636,"props":3375,"children":3376},{"style":648},[3377],{"type":612,"value":3378}," urllib.error\n",{"type":606,"tag":636,"props":3380,"children":3381},{"class":638,"line":36},[3382,3386],{"type":606,"tag":636,"props":3383,"children":3384},{"style":642},[3385],{"type":612,"value":645},{"type":606,"tag":636,"props":3387,"children":3388},{"style":648},[3389],{"type":612,"value":663},{"type":606,"tag":636,"props":3391,"children":3392},{"class":638,"line":45},[3393,3397],{"type":606,"tag":636,"props":3394,"children":3395},{"style":642},[3396],{"type":612,"value":645},{"type":606,"tag":636,"props":3398,"children":3399},{"style":648},[3400],{"type":612,"value":3401}," time\n",{"type":606,"tag":636,"props":3403,"children":3404},{"class":638,"line":54},[3405],{"type":606,"tag":636,"props":3406,"children":3407},{"emptyLinePlaceholder":13},[3408],{"type":612,"value":671},{"type":606,"tag":636,"props":3410,"children":3411},{"class":638,"line":63},[3412,3416,3421,3426,3430,3435,3440,3444,3449,3454,3458,3462,3467,3471,3476],{"type":606,"tag":636,"props":3413,"children":3414},{"style":642},[3415],{"type":612,"value":688},{"type":606,"tag":636,"props":3417,"children":3418},{"style":691},[3419],{"type":612,"value":3420}," api_request_with_retry",{"type":606,"tag":636,"props":3422,"children":3423},{"style":648},[3424],{"type":612,"value":3425},"(url, method",{"type":606,"tag":636,"props":3427,"children":3428},{"style":642},[3429],{"type":612,"value":748},{"type":606,"tag":636,"props":3431,"children":3432},{"style":812},[3433],{"type":612,"value":3434},"'GET'",{"type":606,"tag":636,"props":3436,"children":3437},{"style":648},[3438],{"type":612,"value":3439},", data",{"type":606,"tag":636,"props":3441,"children":3442},{"style":642},[3443],{"type":612,"value":748},{"type":606,"tag":636,"props":3445,"children":3446},{"style":778},[3447],{"type":612,"value":3448},"None",{"type":606,"tag":636,"props":3450,"children":3451},{"style":648},[3452],{"type":612,"value":3453},", headers",{"type":606,"tag":636,"props":3455,"children":3456},{"style":642},[3457],{"type":612,"value":748},{"type":606,"tag":636,"props":3459,"children":3460},{"style":778},[3461],{"type":612,"value":3448},{"type":606,"tag":636,"props":3463,"children":3464},{"style":648},[3465],{"type":612,"value":3466},", max_retries",{"type":606,"tag":636,"props":3468,"children":3469},{"style":642},[3470],{"type":612,"value":748},{"type":606,"tag":636,"props":3472,"children":3473},{"style":778},[3474],{"type":612,"value":3475},"3",{"type":606,"tag":636,"props":3477,"children":3478},{"style":648},[3479],{"type":612,"value":3480},"):\n",{"type":606,"tag":636,"props":3482,"children":3483},{"class":638,"line":72},[3484],{"type":606,"tag":636,"props":3485,"children":3486},{"style":812},[3487],{"type":612,"value":3488},"    \"\"\"Make API request with retry logic and error handling\"\"\"\n",{"type":606,"tag":636,"props":3490,"children":3491},{"class":638,"line":81},[3492],{"type":606,"tag":636,"props":3493,"children":3494},{"style":648},[3495],{"type":612,"value":1370},{"type":606,"tag":636,"props":3497,"children":3498},{"class":638,"line":756},[3499,3504,3509,3514,3519],{"type":606,"tag":636,"props":3500,"children":3501},{"style":642},[3502],{"type":612,"value":3503},"    if",{"type":606,"tag":636,"props":3505,"children":3506},{"style":648},[3507],{"type":612,"value":3508}," headers ",{"type":606,"tag":636,"props":3510,"children":3511},{"style":642},[3512],{"type":612,"value":3513},"is",{"type":606,"tag":636,"props":3515,"children":3516},{"style":778},[3517],{"type":612,"value":3518}," None",{"type":606,"tag":636,"props":3520,"children":3521},{"style":648},[3522],{"type":612,"value":712},{"type":606,"tag":636,"props":3524,"children":3525},{"class":638,"line":99},[3526,3531,3535],{"type":606,"tag":636,"props":3527,"children":3528},{"style":648},[3529],{"type":612,"value":3530},"        headers ",{"type":606,"tag":636,"props":3532,"children":3533},{"style":642},[3534],{"type":612,"value":748},{"type":606,"tag":636,"props":3536,"children":3537},{"style":648},[3538],{"type":612,"value":2972},{"type":606,"tag":636,"props":3540,"children":3541},{"class":638,"line":108},[3542],{"type":606,"tag":636,"props":3543,"children":3544},{"style":648},[3545],{"type":612,"value":1370},{"type":606,"tag":636,"props":3547,"children":3548},{"class":638,"line":117},[3549],{"type":606,"tag":636,"props":3550,"children":3551},{"style":677},[3552],{"type":612,"value":3553},"    # Set default headers\n",{"type":606,"tag":636,"props":3555,"children":3556},{"class":638,"line":126},[3557,3561,3566,3571,3576],{"type":606,"tag":636,"props":3558,"children":3559},{"style":642},[3560],{"type":612,"value":3503},{"type":606,"tag":636,"props":3562,"children":3563},{"style":812},[3564],{"type":612,"value":3565}," 'User-Agent'",{"type":606,"tag":636,"props":3567,"children":3568},{"style":642},[3569],{"type":612,"value":3570}," not",{"type":606,"tag":636,"props":3572,"children":3573},{"style":642},[3574],{"type":612,"value":3575}," in",{"type":606,"tag":636,"props":3577,"children":3578},{"style":648},[3579],{"type":612,"value":3580}," headers:\n",{"type":606,"tag":636,"props":3582,"children":3583},{"class":638,"line":135},[3584,3589,3594,3599,3603],{"type":606,"tag":636,"props":3585,"children":3586},{"style":648},[3587],{"type":612,"value":3588},"        headers[",{"type":606,"tag":636,"props":3590,"children":3591},{"style":812},[3592],{"type":612,"value":3593},"'User-Agent'",{"type":606,"tag":636,"props":3595,"children":3596},{"style":648},[3597],{"type":612,"value":3598},"] ",{"type":606,"tag":636,"props":3600,"children":3601},{"style":642},[3602],{"type":612,"value":748},{"type":606,"tag":636,"props":3604,"children":3605},{"style":812},[3606],{"type":612,"value":3607}," 'Python API Client 1.0'\n",{"type":606,"tag":636,"props":3609,"children":3610},{"class":638,"line":144},[3611],{"type":606,"tag":636,"props":3612,"children":3613},{"style":648},[3614],{"type":612,"value":1370},{"type":606,"tag":636,"props":3616,"children":3617},{"class":638,"line":153},[3618,3623,3628,3633,3638],{"type":606,"tag":636,"props":3619,"children":3620},{"style":642},[3621],{"type":612,"value":3622},"    for",{"type":606,"tag":636,"props":3624,"children":3625},{"style":648},[3626],{"type":612,"value":3627}," attempt ",{"type":606,"tag":636,"props":3629,"children":3630},{"style":642},[3631],{"type":612,"value":3632},"in",{"type":606,"tag":636,"props":3634,"children":3635},{"style":778},[3636],{"type":612,"value":3637}," range",{"type":606,"tag":636,"props":3639,"children":3640},{"style":648},[3641],{"type":612,"value":3642},"(max_retries):\n",{"type":606,"tag":636,"props":3644,"children":3645},{"class":638,"line":163},[3646,3651],{"type":606,"tag":636,"props":3647,"children":3648},{"style":642},[3649],{"type":612,"value":3650},"        try",{"type":606,"tag":636,"props":3652,"children":3653},{"style":648},[3654],{"type":612,"value":712},{"type":606,"tag":636,"props":3656,"children":3657},{"class":638,"line":172},[3658],{"type":606,"tag":636,"props":3659,"children":3660},{"style":677},[3661],{"type":612,"value":3662},"            # Create request\n",{"type":606,"tag":636,"props":3664,"children":3665},{"class":638,"line":181},[3666,3671,3675,3679,3683,3687,3692,3697,3701,3706,3711,3715],{"type":606,"tag":636,"props":3667,"children":3668},{"style":648},[3669],{"type":612,"value":3670},"            req ",{"type":606,"tag":636,"props":3672,"children":3673},{"style":642},[3674],{"type":612,"value":748},{"type":606,"tag":636,"props":3676,"children":3677},{"style":648},[3678],{"type":612,"value":2344},{"type":606,"tag":636,"props":3680,"children":3681},{"style":2347},[3682],{"type":612,"value":2350},{"type":606,"tag":636,"props":3684,"children":3685},{"style":642},[3686],{"type":612,"value":748},{"type":606,"tag":636,"props":3688,"children":3689},{"style":648},[3690],{"type":612,"value":3691},"data, ",{"type":606,"tag":636,"props":3693,"children":3694},{"style":2347},[3695],{"type":612,"value":3696},"headers",{"type":606,"tag":636,"props":3698,"children":3699},{"style":642},[3700],{"type":612,"value":748},{"type":606,"tag":636,"props":3702,"children":3703},{"style":648},[3704],{"type":612,"value":3705},"headers, ",{"type":606,"tag":636,"props":3707,"children":3708},{"style":2347},[3709],{"type":612,"value":3710},"method",{"type":606,"tag":636,"props":3712,"children":3713},{"style":642},[3714],{"type":612,"value":748},{"type":606,"tag":636,"props":3716,"children":3717},{"style":648},[3718],{"type":612,"value":3719},"method)\n",{"type":606,"tag":636,"props":3721,"children":3722},{"class":638,"line":190},[3723],{"type":606,"tag":636,"props":3724,"children":3725},{"style":648},[3726],{"type":612,"value":3727},"            \n",{"type":606,"tag":636,"props":3729,"children":3730},{"class":638,"line":199},[3731,3736,3741,3746,3750,3755,3760,3764],{"type":606,"tag":636,"props":3732,"children":3733},{"style":642},[3734],{"type":612,"value":3735},"            with",{"type":606,"tag":636,"props":3737,"children":3738},{"style":648},[3739],{"type":612,"value":3740}," urllib.request.urlopen(req, ",{"type":606,"tag":636,"props":3742,"children":3743},{"style":2347},[3744],{"type":612,"value":3745},"timeout",{"type":606,"tag":636,"props":3747,"children":3748},{"style":642},[3749],{"type":612,"value":748},{"type":606,"tag":636,"props":3751,"children":3752},{"style":778},[3753],{"type":612,"value":3754},"10",{"type":606,"tag":636,"props":3756,"children":3757},{"style":648},[3758],{"type":612,"value":3759},") ",{"type":606,"tag":636,"props":3761,"children":3762},{"style":642},[3763],{"type":612,"value":730},{"type":606,"tag":636,"props":3765,"children":3766},{"style":648},[3767],{"type":612,"value":735},{"type":606,"tag":636,"props":3769,"children":3770},{"class":638,"line":208},[3771,3776,3780],{"type":606,"tag":636,"props":3772,"children":3773},{"style":648},[3774],{"type":612,"value":3775},"                status_code ",{"type":606,"tag":636,"props":3777,"children":3778},{"style":642},[3779],{"type":612,"value":748},{"type":606,"tag":636,"props":3781,"children":3782},{"style":648},[3783],{"type":612,"value":3784}," response.status\n",{"type":606,"tag":636,"props":3786,"children":3787},{"class":638,"line":217},[3788,3793,3797],{"type":606,"tag":636,"props":3789,"children":3790},{"style":648},[3791],{"type":612,"value":3792},"                response_data ",{"type":606,"tag":636,"props":3794,"children":3795},{"style":642},[3796],{"type":612,"value":748},{"type":606,"tag":636,"props":3798,"children":3799},{"style":648},[3800],{"type":612,"value":753},{"type":606,"tag":636,"props":3802,"children":3803},{"class":638,"line":227},[3804],{"type":606,"tag":636,"props":3805,"children":3806},{"style":648},[3807],{"type":612,"value":3808},"                \n",{"type":606,"tag":636,"props":3810,"children":3811},{"class":638,"line":236},[3812],{"type":606,"tag":636,"props":3813,"children":3814},{"style":677},[3815],{"type":612,"value":3816},"                # Parse JSON if content type indicates JSON\n",{"type":606,"tag":636,"props":3818,"children":3819},{"class":638,"line":245},[3820,3825,3829,3834,3838,3842,3847],{"type":606,"tag":636,"props":3821,"children":3822},{"style":648},[3823],{"type":612,"value":3824},"                content_type ",{"type":606,"tag":636,"props":3826,"children":3827},{"style":642},[3828],{"type":612,"value":748},{"type":606,"tag":636,"props":3830,"children":3831},{"style":648},[3832],{"type":612,"value":3833}," response.headers.get(",{"type":606,"tag":636,"props":3835,"children":3836},{"style":812},[3837],{"type":612,"value":2372},{"type":606,"tag":636,"props":3839,"children":3840},{"style":648},[3841],{"type":612,"value":2377},{"type":606,"tag":636,"props":3843,"children":3844},{"style":812},[3845],{"type":612,"value":3846},"''",{"type":606,"tag":636,"props":3848,"children":3849},{"style":648},[3850],{"type":612,"value":840},{"type":606,"tag":636,"props":3852,"children":3853},{"class":638,"line":254},[3854,3859,3864,3868],{"type":606,"tag":636,"props":3855,"children":3856},{"style":642},[3857],{"type":612,"value":3858},"                if",{"type":606,"tag":636,"props":3860,"children":3861},{"style":812},[3862],{"type":612,"value":3863}," 'application/json'",{"type":606,"tag":636,"props":3865,"children":3866},{"style":642},[3867],{"type":612,"value":3575},{"type":606,"tag":636,"props":3869,"children":3870},{"style":648},[3871],{"type":612,"value":3872}," content_type:\n",{"type":606,"tag":636,"props":3874,"children":3875},{"class":638,"line":263},[3876,3881],{"type":606,"tag":636,"props":3877,"children":3878},{"style":642},[3879],{"type":612,"value":3880},"                    try",{"type":606,"tag":636,"props":3882,"children":3883},{"style":648},[3884],{"type":612,"value":712},{"type":606,"tag":636,"props":3886,"children":3887},{"class":638,"line":272},[3888,3893,3897],{"type":606,"tag":636,"props":3889,"children":3890},{"style":648},[3891],{"type":612,"value":3892},"                        parsed_data ",{"type":606,"tag":636,"props":3894,"children":3895},{"style":642},[3896],{"type":612,"value":748},{"type":606,"tag":636,"props":3898,"children":3899},{"style":648},[3900],{"type":612,"value":3901}," json.loads(response_data)\n",{"type":606,"tag":636,"props":3903,"children":3904},{"class":638,"line":281},[3905,3910],{"type":606,"tag":636,"props":3906,"children":3907},{"style":642},[3908],{"type":612,"value":3909},"                    except",{"type":606,"tag":636,"props":3911,"children":3912},{"style":648},[3913],{"type":612,"value":3914}," json.JSONDecodeError:\n",{"type":606,"tag":636,"props":3916,"children":3917},{"class":638,"line":291},[3918,3922,3926,3931,3935],{"type":606,"tag":636,"props":3919,"children":3920},{"style":648},[3921],{"type":612,"value":3892},{"type":606,"tag":636,"props":3923,"children":3924},{"style":642},[3925],{"type":612,"value":748},{"type":606,"tag":636,"props":3927,"children":3928},{"style":648},[3929],{"type":612,"value":3930}," response_data.decode(",{"type":606,"tag":636,"props":3932,"children":3933},{"style":812},[3934],{"type":612,"value":2308},{"type":606,"tag":636,"props":3936,"children":3937},{"style":648},[3938],{"type":612,"value":840},{"type":606,"tag":636,"props":3940,"children":3941},{"class":638,"line":302},[3942,3947],{"type":606,"tag":636,"props":3943,"children":3944},{"style":642},[3945],{"type":612,"value":3946},"                else",{"type":606,"tag":636,"props":3948,"children":3949},{"style":648},[3950],{"type":612,"value":712},{"type":606,"tag":636,"props":3952,"children":3953},{"class":638,"line":311},[3954,3959,3963,3967,3971],{"type":606,"tag":636,"props":3955,"children":3956},{"style":648},[3957],{"type":612,"value":3958},"                    parsed_data ",{"type":606,"tag":636,"props":3960,"children":3961},{"style":642},[3962],{"type":612,"value":748},{"type":606,"tag":636,"props":3964,"children":3965},{"style":648},[3966],{"type":612,"value":3930},{"type":606,"tag":636,"props":3968,"children":3969},{"style":812},[3970],{"type":612,"value":2308},{"type":606,"tag":636,"props":3972,"children":3973},{"style":648},[3974],{"type":612,"value":840},{"type":606,"tag":636,"props":3976,"children":3977},{"class":638,"line":320},[3978],{"type":606,"tag":636,"props":3979,"children":3980},{"style":648},[3981],{"type":612,"value":3808},{"type":606,"tag":636,"props":3983,"children":3984},{"class":638,"line":329},[3985,3989],{"type":606,"tag":636,"props":3986,"children":3987},{"style":642},[3988],{"type":612,"value":1524},{"type":606,"tag":636,"props":3990,"children":3991},{"style":648},[3992],{"type":612,"value":1722},{"type":606,"tag":636,"props":3994,"children":3995},{"class":638,"line":338},[3996,4001,4005,4010],{"type":606,"tag":636,"props":3997,"children":3998},{"style":812},[3999],{"type":612,"value":4000},"                    'success'",{"type":606,"tag":636,"props":4002,"children":4003},{"style":648},[4004],{"type":612,"value":1735},{"type":606,"tag":636,"props":4006,"children":4007},{"style":778},[4008],{"type":612,"value":4009},"True",{"type":606,"tag":636,"props":4011,"children":4012},{"style":648},[4013],{"type":612,"value":1745},{"type":606,"tag":636,"props":4015,"children":4016},{"class":638,"line":347},[4017,4022],{"type":606,"tag":636,"props":4018,"children":4019},{"style":812},[4020],{"type":612,"value":4021},"                    'status_code'",{"type":606,"tag":636,"props":4023,"children":4024},{"style":648},[4025],{"type":612,"value":4026},": status_code,\n",{"type":606,"tag":636,"props":4028,"children":4029},{"class":638,"line":356},[4030,4035],{"type":606,"tag":636,"props":4031,"children":4032},{"style":812},[4033],{"type":612,"value":4034},"                    'data'",{"type":606,"tag":636,"props":4036,"children":4037},{"style":648},[4038],{"type":612,"value":4039},": parsed_data,\n",{"type":606,"tag":636,"props":4041,"children":4042},{"class":638,"line":367},[4043,4048,4052,4057],{"type":606,"tag":636,"props":4044,"children":4045},{"style":812},[4046],{"type":612,"value":4047},"                    'headers'",{"type":606,"tag":636,"props":4049,"children":4050},{"style":648},[4051],{"type":612,"value":1735},{"type":606,"tag":636,"props":4053,"children":4054},{"style":778},[4055],{"type":612,"value":4056},"dict",{"type":606,"tag":636,"props":4058,"children":4059},{"style":648},[4060],{"type":612,"value":4061},"(response.headers)\n",{"type":606,"tag":636,"props":4063,"children":4064},{"class":638,"line":376},[4065],{"type":606,"tag":636,"props":4066,"children":4067},{"style":648},[4068],{"type":612,"value":4069},"                }\n",{"type":606,"tag":636,"props":4071,"children":4072},{"class":638,"line":385},[4073],{"type":606,"tag":636,"props":4074,"children":4075},{"style":648},[4076],{"type":612,"value":3808},{"type":606,"tag":636,"props":4078,"children":4079},{"class":638,"line":394},[4080,4085,4090,4094],{"type":606,"tag":636,"props":4081,"children":4082},{"style":642},[4083],{"type":612,"value":4084},"        except",{"type":606,"tag":636,"props":4086,"children":4087},{"style":648},[4088],{"type":612,"value":4089}," urllib.error.HTTPError ",{"type":606,"tag":636,"props":4091,"children":4092},{"style":642},[4093],{"type":612,"value":730},{"type":606,"tag":636,"props":4095,"children":4096},{"style":648},[4097],{"type":612,"value":791},{"type":606,"tag":636,"props":4099,"children":4100},{"class":638,"line":403},[4101,4106,4110],{"type":606,"tag":636,"props":4102,"children":4103},{"style":648},[4104],{"type":612,"value":4105},"            status_code ",{"type":606,"tag":636,"props":4107,"children":4108},{"style":642},[4109],{"type":612,"value":748},{"type":606,"tag":636,"props":4111,"children":4112},{"style":648},[4113],{"type":612,"value":4114}," e.code\n",{"type":606,"tag":636,"props":4116,"children":4117},{"class":638,"line":412},[4118,4123,4127,4131,4136,4140,4145,4149,4153,4157,4162,4166],{"type":606,"tag":636,"props":4119,"children":4120},{"style":648},[4121],{"type":612,"value":4122},"            error_msg ",{"type":606,"tag":636,"props":4124,"children":4125},{"style":642},[4126],{"type":612,"value":748},{"type":606,"tag":636,"props":4128,"children":4129},{"style":642},[4130],{"type":612,"value":1395},{"type":606,"tag":636,"props":4132,"children":4133},{"style":812},[4134],{"type":612,"value":4135},"\"HTTP ",{"type":606,"tag":636,"props":4137,"children":4138},{"style":778},[4139],{"type":612,"value":820},{"type":606,"tag":636,"props":4141,"children":4142},{"style":648},[4143],{"type":612,"value":4144},"status_code",{"type":606,"tag":636,"props":4146,"children":4147},{"style":778},[4148],{"type":612,"value":830},{"type":606,"tag":636,"props":4150,"children":4151},{"style":812},[4152],{"type":612,"value":1735},{"type":606,"tag":636,"props":4154,"children":4155},{"style":778},[4156],{"type":612,"value":820},{"type":606,"tag":636,"props":4158,"children":4159},{"style":648},[4160],{"type":612,"value":4161},"e.reason",{"type":606,"tag":636,"props":4163,"children":4164},{"style":778},[4165],{"type":612,"value":830},{"type":606,"tag":636,"props":4167,"children":4168},{"style":812},[4169],{"type":612,"value":1435},{"type":606,"tag":636,"props":4171,"children":4172},{"class":638,"line":423},[4173],{"type":606,"tag":636,"props":4174,"children":4175},{"style":648},[4176],{"type":612,"value":3727},{"type":606,"tag":636,"props":4178,"children":4179},{"class":638,"line":432},[4180,4184,4189,4194,4199,4204,4208,4213,4218,4223,4228],{"type":606,"tag":636,"props":4181,"children":4182},{"style":642},[4183],{"type":612,"value":1480},{"type":606,"tag":636,"props":4185,"children":4186},{"style":648},[4187],{"type":612,"value":4188}," status_code ",{"type":606,"tag":636,"props":4190,"children":4191},{"style":642},[4192],{"type":612,"value":4193},">=",{"type":606,"tag":636,"props":4195,"children":4196},{"style":778},[4197],{"type":612,"value":4198}," 500",{"type":606,"tag":636,"props":4200,"children":4201},{"style":642},[4202],{"type":612,"value":4203}," and",{"type":606,"tag":636,"props":4205,"children":4206},{"style":648},[4207],{"type":612,"value":3627},{"type":606,"tag":636,"props":4209,"children":4210},{"style":642},[4211],{"type":612,"value":4212},"\u003C",{"type":606,"tag":636,"props":4214,"children":4215},{"style":648},[4216],{"type":612,"value":4217}," max_retries ",{"type":606,"tag":636,"props":4219,"children":4220},{"style":642},[4221],{"type":612,"value":4222},"-",{"type":606,"tag":636,"props":4224,"children":4225},{"style":778},[4226],{"type":612,"value":4227}," 1",{"type":606,"tag":636,"props":4229,"children":4230},{"style":648},[4231],{"type":612,"value":712},{"type":606,"tag":636,"props":4233,"children":4234},{"class":638,"line":441},[4235],{"type":606,"tag":636,"props":4236,"children":4237},{"style":677},[4238],{"type":612,"value":4239},"                # Retry on server errors\n",{"type":606,"tag":636,"props":4241,"children":4242},{"class":638,"line":450},[4243,4247,4251,4255,4260,4265,4270,4275,4279,4284],{"type":606,"tag":636,"props":4244,"children":4245},{"style":778},[4246],{"type":612,"value":1549},{"type":606,"tag":636,"props":4248,"children":4249},{"style":648},[4250],{"type":612,"value":804},{"type":606,"tag":636,"props":4252,"children":4253},{"style":642},[4254],{"type":612,"value":809},{"type":606,"tag":636,"props":4256,"children":4257},{"style":812},[4258],{"type":612,"value":4259},"\"Server error, retrying in ",{"type":606,"tag":636,"props":4261,"children":4262},{"style":778},[4263],{"type":612,"value":4264},"{2",{"type":606,"tag":636,"props":4266,"children":4267},{"style":642},[4268],{"type":612,"value":4269}," **",{"type":606,"tag":636,"props":4271,"children":4272},{"style":648},[4273],{"type":612,"value":4274}," attempt",{"type":606,"tag":636,"props":4276,"children":4277},{"style":778},[4278],{"type":612,"value":830},{"type":606,"tag":636,"props":4280,"children":4281},{"style":812},[4282],{"type":612,"value":4283}," seconds...\"",{"type":606,"tag":636,"props":4285,"children":4286},{"style":648},[4287],{"type":612,"value":840},{"type":606,"tag":636,"props":4289,"children":4290},{"class":638,"line":459},[4291,4296,4301,4305],{"type":606,"tag":636,"props":4292,"children":4293},{"style":648},[4294],{"type":612,"value":4295},"                time.sleep(",{"type":606,"tag":636,"props":4297,"children":4298},{"style":778},[4299],{"type":612,"value":4300},"2",{"type":606,"tag":636,"props":4302,"children":4303},{"style":642},[4304],{"type":612,"value":4269},{"type":606,"tag":636,"props":4306,"children":4307},{"style":648},[4308],{"type":612,"value":4309}," attempt)\n",{"type":606,"tag":636,"props":4311,"children":4312},{"class":638,"line":468},[4313],{"type":606,"tag":636,"props":4314,"children":4315},{"style":642},[4316],{"type":612,"value":4317},"                continue\n",{"type":606,"tag":636,"props":4319,"children":4320},{"class":638,"line":477},[4321,4325],{"type":606,"tag":636,"props":4322,"children":4323},{"style":642},[4324],{"type":612,"value":1537},{"type":606,"tag":636,"props":4326,"children":4327},{"style":648},[4328],{"type":612,"value":712},{"type":606,"tag":636,"props":4330,"children":4331},{"class":638,"line":488},[4332,4336],{"type":606,"tag":636,"props":4333,"children":4334},{"style":642},[4335],{"type":612,"value":1524},{"type":606,"tag":636,"props":4337,"children":4338},{"style":648},[4339],{"type":612,"value":1722},{"type":606,"tag":636,"props":4341,"children":4342},{"class":638,"line":497},[4343,4347,4351,4356],{"type":606,"tag":636,"props":4344,"children":4345},{"style":812},[4346],{"type":612,"value":4000},{"type":606,"tag":636,"props":4348,"children":4349},{"style":648},[4350],{"type":612,"value":1735},{"type":606,"tag":636,"props":4352,"children":4353},{"style":778},[4354],{"type":612,"value":4355},"False",{"type":606,"tag":636,"props":4357,"children":4358},{"style":648},[4359],{"type":612,"value":1745},{"type":606,"tag":636,"props":4361,"children":4362},{"class":638,"line":506},[4363,4367],{"type":606,"tag":636,"props":4364,"children":4365},{"style":812},[4366],{"type":612,"value":4021},{"type":606,"tag":636,"props":4368,"children":4369},{"style":648},[4370],{"type":612,"value":4026},{"type":606,"tag":636,"props":4372,"children":4373},{"class":638,"line":515},[4374,4379],{"type":606,"tag":636,"props":4375,"children":4376},{"style":812},[4377],{"type":612,"value":4378},"                    'error'",{"type":606,"tag":636,"props":4380,"children":4381},{"style":648},[4382],{"type":612,"value":4383},": error_msg\n",{"type":606,"tag":636,"props":4385,"children":4386},{"class":638,"line":524},[4387],{"type":606,"tag":636,"props":4388,"children":4389},{"style":648},[4390],{"type":612,"value":4069},{"type":606,"tag":636,"props":4392,"children":4393},{"class":638,"line":533},[4394],{"type":606,"tag":636,"props":4395,"children":4396},{"style":648},[4397],{"type":612,"value":3808},{"type":606,"tag":636,"props":4399,"children":4400},{"class":638,"line":544},[4401,4405,4410,4414],{"type":606,"tag":636,"props":4402,"children":4403},{"style":642},[4404],{"type":612,"value":4084},{"type":606,"tag":636,"props":4406,"children":4407},{"style":648},[4408],{"type":612,"value":4409}," urllib.error.URLError ",{"type":606,"tag":636,"props":4411,"children":4412},{"style":642},[4413],{"type":612,"value":730},{"type":606,"tag":636,"props":4415,"children":4416},{"style":648},[4417],{"type":612,"value":791},{"type":606,"tag":636,"props":4419,"children":4420},{"class":638,"line":553},[4421,4425,4429,4433,4438,4442,4446,4450],{"type":606,"tag":636,"props":4422,"children":4423},{"style":648},[4424],{"type":612,"value":4122},{"type":606,"tag":636,"props":4426,"children":4427},{"style":642},[4428],{"type":612,"value":748},{"type":606,"tag":636,"props":4430,"children":4431},{"style":642},[4432],{"type":612,"value":1395},{"type":606,"tag":636,"props":4434,"children":4435},{"style":812},[4436],{"type":612,"value":4437},"\"Network error: ",{"type":606,"tag":636,"props":4439,"children":4440},{"style":778},[4441],{"type":612,"value":820},{"type":606,"tag":636,"props":4443,"children":4444},{"style":648},[4445],{"type":612,"value":4161},{"type":606,"tag":636,"props":4447,"children":4448},{"style":778},[4449],{"type":612,"value":830},{"type":606,"tag":636,"props":4451,"children":4452},{"style":812},[4453],{"type":612,"value":1435},{"type":606,"tag":636,"props":4455,"children":4456},{"class":638,"line":562},[4457,4461,4465,4469,4473,4477,4481],{"type":606,"tag":636,"props":4458,"children":4459},{"style":642},[4460],{"type":612,"value":1480},{"type":606,"tag":636,"props":4462,"children":4463},{"style":648},[4464],{"type":612,"value":3627},{"type":606,"tag":636,"props":4466,"children":4467},{"style":642},[4468],{"type":612,"value":4212},{"type":606,"tag":636,"props":4470,"children":4471},{"style":648},[4472],{"type":612,"value":4217},{"type":606,"tag":636,"props":4474,"children":4475},{"style":642},[4476],{"type":612,"value":4222},{"type":606,"tag":636,"props":4478,"children":4479},{"style":778},[4480],{"type":612,"value":4227},{"type":606,"tag":636,"props":4482,"children":4483},{"style":648},[4484],{"type":612,"value":712},{"type":606,"tag":636,"props":4486,"children":4487},{"class":638,"line":571},[4488,4492,4496,4500,4505,4509,4513,4517,4521,4525],{"type":606,"tag":636,"props":4489,"children":4490},{"style":778},[4491],{"type":612,"value":1549},{"type":606,"tag":636,"props":4493,"children":4494},{"style":648},[4495],{"type":612,"value":804},{"type":606,"tag":636,"props":4497,"children":4498},{"style":642},[4499],{"type":612,"value":809},{"type":606,"tag":636,"props":4501,"children":4502},{"style":812},[4503],{"type":612,"value":4504},"\"Network error, retrying in ",{"type":606,"tag":636,"props":4506,"children":4507},{"style":778},[4508],{"type":612,"value":4264},{"type":606,"tag":636,"props":4510,"children":4511},{"style":642},[4512],{"type":612,"value":4269},{"type":606,"tag":636,"props":4514,"children":4515},{"style":648},[4516],{"type":612,"value":4274},{"type":606,"tag":636,"props":4518,"children":4519},{"style":778},[4520],{"type":612,"value":830},{"type":606,"tag":636,"props":4522,"children":4523},{"style":812},[4524],{"type":612,"value":4283},{"type":606,"tag":636,"props":4526,"children":4527},{"style":648},[4528],{"type":612,"value":840},{"type":606,"tag":636,"props":4530,"children":4531},{"class":638,"line":580},[4532,4536,4540,4544],{"type":606,"tag":636,"props":4533,"children":4534},{"style":648},[4535],{"type":612,"value":4295},{"type":606,"tag":636,"props":4537,"children":4538},{"style":778},[4539],{"type":612,"value":4300},{"type":606,"tag":636,"props":4541,"children":4542},{"style":642},[4543],{"type":612,"value":4269},{"type":606,"tag":636,"props":4545,"children":4546},{"style":648},[4547],{"type":612,"value":4309},{"type":606,"tag":636,"props":4549,"children":4550},{"class":638,"line":589},[4551],{"type":606,"tag":636,"props":4552,"children":4553},{"style":642},[4554],{"type":612,"value":4317},{"type":606,"tag":636,"props":4556,"children":4557},{"class":638,"line":3094},[4558,4562],{"type":606,"tag":636,"props":4559,"children":4560},{"style":642},[4561],{"type":612,"value":1537},{"type":606,"tag":636,"props":4563,"children":4564},{"style":648},[4565],{"type":612,"value":712},{"type":606,"tag":636,"props":4567,"children":4568},{"class":638,"line":3102},[4569,4573],{"type":606,"tag":636,"props":4570,"children":4571},{"style":642},[4572],{"type":612,"value":1524},{"type":606,"tag":636,"props":4574,"children":4575},{"style":648},[4576],{"type":612,"value":1722},{"type":606,"tag":636,"props":4578,"children":4579},{"class":638,"line":3111},[4580,4584,4588,4592],{"type":606,"tag":636,"props":4581,"children":4582},{"style":812},[4583],{"type":612,"value":4000},{"type":606,"tag":636,"props":4585,"children":4586},{"style":648},[4587],{"type":612,"value":1735},{"type":606,"tag":636,"props":4589,"children":4590},{"style":778},[4591],{"type":612,"value":4355},{"type":606,"tag":636,"props":4593,"children":4594},{"style":648},[4595],{"type":612,"value":1745},{"type":606,"tag":636,"props":4597,"children":4598},{"class":638,"line":3147},[4599,4603],{"type":606,"tag":636,"props":4600,"children":4601},{"style":812},[4602],{"type":612,"value":4378},{"type":606,"tag":636,"props":4604,"children":4605},{"style":648},[4606],{"type":612,"value":4383},{"type":606,"tag":636,"props":4608,"children":4610},{"class":638,"line":4609},68,[4611],{"type":606,"tag":636,"props":4612,"children":4613},{"style":648},[4614],{"type":612,"value":4069},{"type":606,"tag":636,"props":4616,"children":4618},{"class":638,"line":4617},69,[4619],{"type":606,"tag":636,"props":4620,"children":4621},{"style":648},[4622],{"type":612,"value":4623},"        \n",{"type":606,"tag":636,"props":4625,"children":4627},{"class":638,"line":4626},70,[4628,4632,4636,4640],{"type":606,"tag":636,"props":4629,"children":4630},{"style":642},[4631],{"type":612,"value":4084},{"type":606,"tag":636,"props":4633,"children":4634},{"style":778},[4635],{"type":612,"value":781},{"type":606,"tag":636,"props":4637,"children":4638},{"style":642},[4639],{"type":612,"value":786},{"type":606,"tag":636,"props":4641,"children":4642},{"style":648},[4643],{"type":612,"value":791},{"type":606,"tag":636,"props":4645,"children":4647},{"class":638,"line":4646},71,[4648,4652],{"type":606,"tag":636,"props":4649,"children":4650},{"style":642},[4651],{"type":612,"value":762},{"type":606,"tag":636,"props":4653,"children":4654},{"style":648},[4655],{"type":612,"value":1722},{"type":606,"tag":636,"props":4657,"children":4659},{"class":638,"line":4658},72,[4660,4665,4669,4673],{"type":606,"tag":636,"props":4661,"children":4662},{"style":812},[4663],{"type":612,"value":4664},"                'success'",{"type":606,"tag":636,"props":4666,"children":4667},{"style":648},[4668],{"type":612,"value":1735},{"type":606,"tag":636,"props":4670,"children":4671},{"style":778},[4672],{"type":612,"value":4355},{"type":606,"tag":636,"props":4674,"children":4675},{"style":648},[4676],{"type":612,"value":1745},{"type":606,"tag":636,"props":4678,"children":4680},{"class":638,"line":4679},73,[4681,4686,4690,4694,4699,4704,4709,4713],{"type":606,"tag":636,"props":4682,"children":4683},{"style":812},[4684],{"type":612,"value":4685},"                'error'",{"type":606,"tag":636,"props":4687,"children":4688},{"style":648},[4689],{"type":612,"value":1735},{"type":606,"tag":636,"props":4691,"children":4692},{"style":642},[4693],{"type":612,"value":809},{"type":606,"tag":636,"props":4695,"children":4696},{"style":812},[4697],{"type":612,"value":4698},"\"Unexpected error: ",{"type":606,"tag":636,"props":4700,"children":4701},{"style":778},[4702],{"type":612,"value":4703},"{str",{"type":606,"tag":636,"props":4705,"children":4706},{"style":648},[4707],{"type":612,"value":4708},"(e)",{"type":606,"tag":636,"props":4710,"children":4711},{"style":778},[4712],{"type":612,"value":830},{"type":606,"tag":636,"props":4714,"children":4715},{"style":812},[4716],{"type":612,"value":1435},{"type":606,"tag":636,"props":4718,"children":4720},{"class":638,"line":4719},74,[4721],{"type":606,"tag":636,"props":4722,"children":4723},{"style":648},[4724],{"type":612,"value":4725},"            }\n",{"type":606,"tag":636,"props":4727,"children":4729},{"class":638,"line":4728},75,[4730],{"type":606,"tag":636,"props":4731,"children":4732},{"style":648},[4733],{"type":612,"value":1370},{"type":606,"tag":636,"props":4735,"children":4737},{"class":638,"line":4736},76,[4738,4742],{"type":606,"tag":636,"props":4739,"children":4740},{"style":642},[4741],{"type":612,"value":1820},{"type":606,"tag":636,"props":4743,"children":4744},{"style":648},[4745],{"type":612,"value":1722},{"type":606,"tag":636,"props":4747,"children":4749},{"class":638,"line":4748},77,[4750,4755,4759,4763],{"type":606,"tag":636,"props":4751,"children":4752},{"style":812},[4753],{"type":612,"value":4754},"        'success'",{"type":606,"tag":636,"props":4756,"children":4757},{"style":648},[4758],{"type":612,"value":1735},{"type":606,"tag":636,"props":4760,"children":4761},{"style":778},[4762],{"type":612,"value":4355},{"type":606,"tag":636,"props":4764,"children":4765},{"style":648},[4766],{"type":612,"value":1745},{"type":606,"tag":636,"props":4768,"children":4770},{"class":638,"line":4769},78,[4771,4776,4780,4784,4789,4793,4798,4802],{"type":606,"tag":636,"props":4772,"children":4773},{"style":812},[4774],{"type":612,"value":4775},"        'error'",{"type":606,"tag":636,"props":4777,"children":4778},{"style":648},[4779],{"type":612,"value":1735},{"type":606,"tag":636,"props":4781,"children":4782},{"style":642},[4783],{"type":612,"value":809},{"type":606,"tag":636,"props":4785,"children":4786},{"style":812},[4787],{"type":612,"value":4788},"\"Max retries (",{"type":606,"tag":636,"props":4790,"children":4791},{"style":778},[4792],{"type":612,"value":820},{"type":606,"tag":636,"props":4794,"children":4795},{"style":648},[4796],{"type":612,"value":4797},"max_retries",{"type":606,"tag":636,"props":4799,"children":4800},{"style":778},[4801],{"type":612,"value":830},{"type":606,"tag":636,"props":4803,"children":4804},{"style":812},[4805],{"type":612,"value":4806},") exceeded\"\n",{"type":606,"tag":636,"props":4808,"children":4810},{"class":638,"line":4809},79,[4811],{"type":606,"tag":636,"props":4812,"children":4813},{"style":648},[4814],{"type":612,"value":1812},{"type":606,"tag":636,"props":4816,"children":4818},{"class":638,"line":4817},80,[4819],{"type":606,"tag":636,"props":4820,"children":4821},{"emptyLinePlaceholder":13},[4822],{"type":612,"value":671},{"type":606,"tag":636,"props":4824,"children":4826},{"class":638,"line":4825},81,[4827],{"type":606,"tag":636,"props":4828,"children":4829},{"style":677},[4830],{"type":612,"value":4831},"# Test robust API handler\n",{"type":606,"tag":636,"props":4833,"children":4835},{"class":638,"line":4834},82,[4836,4840,4845],{"type":606,"tag":636,"props":4837,"children":4838},{"style":642},[4839],{"type":612,"value":688},{"type":606,"tag":636,"props":4841,"children":4842},{"style":691},[4843],{"type":612,"value":4844}," test_api_endpoints",{"type":606,"tag":636,"props":4846,"children":4847},{"style":648},[4848],{"type":612,"value":1689},{"type":606,"tag":636,"props":4850,"children":4852},{"class":638,"line":4851},83,[4853],{"type":606,"tag":636,"props":4854,"children":4855},{"style":812},[4856],{"type":612,"value":4857},"    \"\"\"Test various API scenarios\"\"\"\n",{"type":606,"tag":636,"props":4859,"children":4861},{"class":638,"line":4860},84,[4862],{"type":606,"tag":636,"props":4863,"children":4864},{"style":648},[4865],{"type":612,"value":1370},{"type":606,"tag":636,"props":4867,"children":4869},{"class":638,"line":4868},85,[4870],{"type":606,"tag":636,"props":4871,"children":4872},{"style":677},[4873],{"type":612,"value":4874},"    # Test successful request\n",{"type":606,"tag":636,"props":4876,"children":4878},{"class":638,"line":4877},86,[4879,4884,4888,4893,4898],{"type":606,"tag":636,"props":4880,"children":4881},{"style":648},[4882],{"type":612,"value":4883},"    result ",{"type":606,"tag":636,"props":4885,"children":4886},{"style":642},[4887],{"type":612,"value":748},{"type":606,"tag":636,"props":4889,"children":4890},{"style":648},[4891],{"type":612,"value":4892}," api_request_with_retry(",{"type":606,"tag":636,"props":4894,"children":4895},{"style":812},[4896],{"type":612,"value":4897},"\"https://jsonplaceholder.typicode.com/posts/1\"",{"type":606,"tag":636,"props":4899,"children":4900},{"style":648},[4901],{"type":612,"value":840},{"type":606,"tag":636,"props":4903,"children":4905},{"class":638,"line":4904},87,[4906,4910,4915,4920],{"type":606,"tag":636,"props":4907,"children":4908},{"style":642},[4909],{"type":612,"value":3503},{"type":606,"tag":636,"props":4911,"children":4912},{"style":648},[4913],{"type":612,"value":4914}," result[",{"type":606,"tag":636,"props":4916,"children":4917},{"style":812},[4918],{"type":612,"value":4919},"'success'",{"type":606,"tag":636,"props":4921,"children":4922},{"style":648},[4923],{"type":612,"value":4924},"]:\n",{"type":606,"tag":636,"props":4926,"children":4928},{"class":638,"line":4927},88,[4929,4933,4937,4941,4946,4950,4955,4960,4964,4968,4972,4976,4980],{"type":606,"tag":636,"props":4930,"children":4931},{"style":778},[4932],{"type":612,"value":799},{"type":606,"tag":636,"props":4934,"children":4935},{"style":648},[4936],{"type":612,"value":804},{"type":606,"tag":636,"props":4938,"children":4939},{"style":642},[4940],{"type":612,"value":809},{"type":606,"tag":636,"props":4942,"children":4943},{"style":812},[4944],{"type":612,"value":4945},"\"Success: Got post with title: ",{"type":606,"tag":636,"props":4947,"children":4948},{"style":778},[4949],{"type":612,"value":820},{"type":606,"tag":636,"props":4951,"children":4952},{"style":648},[4953],{"type":612,"value":4954},"result[",{"type":606,"tag":636,"props":4956,"children":4957},{"style":812},[4958],{"type":612,"value":4959},"'data'",{"type":606,"tag":636,"props":4961,"children":4962},{"style":648},[4963],{"type":612,"value":1961},{"type":606,"tag":636,"props":4965,"children":4966},{"style":812},[4967],{"type":612,"value":1007},{"type":606,"tag":636,"props":4969,"children":4970},{"style":648},[4971],{"type":612,"value":962},{"type":606,"tag":636,"props":4973,"children":4974},{"style":778},[4975],{"type":612,"value":830},{"type":606,"tag":636,"props":4977,"children":4978},{"style":812},[4979],{"type":612,"value":835},{"type":606,"tag":636,"props":4981,"children":4982},{"style":648},[4983],{"type":612,"value":840},{"type":606,"tag":636,"props":4985,"children":4987},{"class":638,"line":4986},89,[4988,4993],{"type":606,"tag":636,"props":4989,"children":4990},{"style":642},[4991],{"type":612,"value":4992},"    else",{"type":606,"tag":636,"props":4994,"children":4995},{"style":648},[4996],{"type":612,"value":712},{"type":606,"tag":636,"props":4998,"children":5000},{"class":638,"line":4999},90,[5001,5005,5009,5013,5018,5022,5026,5031,5035,5039,5043],{"type":606,"tag":636,"props":5002,"children":5003},{"style":778},[5004],{"type":612,"value":799},{"type":606,"tag":636,"props":5006,"children":5007},{"style":648},[5008],{"type":612,"value":804},{"type":606,"tag":636,"props":5010,"children":5011},{"style":642},[5012],{"type":612,"value":809},{"type":606,"tag":636,"props":5014,"children":5015},{"style":812},[5016],{"type":612,"value":5017},"\"Failed: ",{"type":606,"tag":636,"props":5019,"children":5020},{"style":778},[5021],{"type":612,"value":820},{"type":606,"tag":636,"props":5023,"children":5024},{"style":648},[5025],{"type":612,"value":4954},{"type":606,"tag":636,"props":5027,"children":5028},{"style":812},[5029],{"type":612,"value":5030},"'error'",{"type":606,"tag":636,"props":5032,"children":5033},{"style":648},[5034],{"type":612,"value":962},{"type":606,"tag":636,"props":5036,"children":5037},{"style":778},[5038],{"type":612,"value":830},{"type":606,"tag":636,"props":5040,"children":5041},{"style":812},[5042],{"type":612,"value":835},{"type":606,"tag":636,"props":5044,"children":5045},{"style":648},[5046],{"type":612,"value":840},{"type":606,"tag":636,"props":5048,"children":5050},{"class":638,"line":5049},91,[5051],{"type":606,"tag":636,"props":5052,"children":5053},{"style":648},[5054],{"type":612,"value":1370},{"type":606,"tag":636,"props":5056,"children":5058},{"class":638,"line":5057},92,[5059],{"type":606,"tag":636,"props":5060,"children":5061},{"style":677},[5062],{"type":612,"value":5063},"    # Test 404 error\n",{"type":606,"tag":636,"props":5065,"children":5067},{"class":638,"line":5066},93,[5068,5072,5076,5080,5085],{"type":606,"tag":636,"props":5069,"children":5070},{"style":648},[5071],{"type":612,"value":4883},{"type":606,"tag":636,"props":5073,"children":5074},{"style":642},[5075],{"type":612,"value":748},{"type":606,"tag":636,"props":5077,"children":5078},{"style":648},[5079],{"type":612,"value":4892},{"type":606,"tag":636,"props":5081,"children":5082},{"style":812},[5083],{"type":612,"value":5084},"\"https://jsonplaceholder.typicode.com/posts/99999\"",{"type":606,"tag":636,"props":5086,"children":5087},{"style":648},[5088],{"type":612,"value":840},{"type":606,"tag":636,"props":5090,"children":5092},{"class":638,"line":5091},94,[5093,5097,5101,5105],{"type":606,"tag":636,"props":5094,"children":5095},{"style":642},[5096],{"type":612,"value":3503},{"type":606,"tag":636,"props":5098,"children":5099},{"style":648},[5100],{"type":612,"value":4914},{"type":606,"tag":636,"props":5102,"children":5103},{"style":812},[5104],{"type":612,"value":4919},{"type":606,"tag":636,"props":5106,"children":5107},{"style":648},[5108],{"type":612,"value":4924},{"type":606,"tag":636,"props":5110,"children":5112},{"class":638,"line":5111},95,[5113,5117,5121,5126],{"type":606,"tag":636,"props":5114,"children":5115},{"style":778},[5116],{"type":612,"value":799},{"type":606,"tag":636,"props":5118,"children":5119},{"style":648},[5120],{"type":612,"value":804},{"type":606,"tag":636,"props":5122,"children":5123},{"style":812},[5124],{"type":612,"value":5125},"\"Success: Found post\"",{"type":606,"tag":636,"props":5127,"children":5128},{"style":648},[5129],{"type":612,"value":840},{"type":606,"tag":636,"props":5131,"children":5133},{"class":638,"line":5132},96,[5134,5138],{"type":606,"tag":636,"props":5135,"children":5136},{"style":642},[5137],{"type":612,"value":4992},{"type":606,"tag":636,"props":5139,"children":5140},{"style":648},[5141],{"type":612,"value":712},{"type":606,"tag":636,"props":5143,"children":5145},{"class":638,"line":5144},97,[5146,5150,5154,5158,5163,5167,5171,5175,5179,5183,5187],{"type":606,"tag":636,"props":5147,"children":5148},{"style":778},[5149],{"type":612,"value":799},{"type":606,"tag":636,"props":5151,"children":5152},{"style":648},[5153],{"type":612,"value":804},{"type":606,"tag":636,"props":5155,"children":5156},{"style":642},[5157],{"type":612,"value":809},{"type":606,"tag":636,"props":5159,"children":5160},{"style":812},[5161],{"type":612,"value":5162},"\"Expected 404: ",{"type":606,"tag":636,"props":5164,"children":5165},{"style":778},[5166],{"type":612,"value":820},{"type":606,"tag":636,"props":5168,"children":5169},{"style":648},[5170],{"type":612,"value":4954},{"type":606,"tag":636,"props":5172,"children":5173},{"style":812},[5174],{"type":612,"value":5030},{"type":606,"tag":636,"props":5176,"children":5177},{"style":648},[5178],{"type":612,"value":962},{"type":606,"tag":636,"props":5180,"children":5181},{"style":778},[5182],{"type":612,"value":830},{"type":606,"tag":636,"props":5184,"children":5185},{"style":812},[5186],{"type":612,"value":835},{"type":606,"tag":636,"props":5188,"children":5189},{"style":648},[5190],{"type":612,"value":840},{"type":606,"tag":636,"props":5192,"children":5194},{"class":638,"line":5193},98,[5195],{"type":606,"tag":636,"props":5196,"children":5197},{"emptyLinePlaceholder":13},[5198],{"type":612,"value":671},{"type":606,"tag":636,"props":5200,"children":5202},{"class":638,"line":5201},99,[5203],{"type":606,"tag":636,"props":5204,"children":5205},{"style":648},[5206],{"type":612,"value":5207},"test_api_endpoints()\n",{"type":606,"tag":1085,"props":5209,"children":5211},{"id":5210},"key-takeaways",[5212],{"type":612,"value":5213},"🎯 Key Takeaways",{"type":606,"tag":1097,"props":5215,"children":5219},{"emoji":5216,"title":5217,"type":5218},"📚","API Request Essentials","success",[5220,5228,5259,5267,5290,5298,5321],{"type":606,"tag":615,"props":5221,"children":5222},{},[5223],{"type":606,"tag":1107,"props":5224,"children":5225},{},[5226],{"type":612,"value":5227},"Making Requests:",{"type":606,"tag":1113,"props":5229,"children":5230},{},[5231,5244,5249,5254],{"type":606,"tag":1117,"props":5232,"children":5233},{},[5234,5236,5242],{"type":612,"value":5235},"Use ",{"type":606,"tag":632,"props":5237,"children":5239},{"className":5238},[],[5240],{"type":612,"value":5241},"urllib.request",{"type":612,"value":5243}," for basic HTTP requests",{"type":606,"tag":1117,"props":5245,"children":5246},{},[5247],{"type":612,"value":5248},"Handle different HTTP methods (GET, POST, PUT, DELETE)",{"type":606,"tag":1117,"props":5250,"children":5251},{},[5252],{"type":612,"value":5253},"Set proper headers and content types",{"type":606,"tag":1117,"props":5255,"children":5256},{},[5257],{"type":612,"value":5258},"Include authentication (API keys, tokens)",{"type":606,"tag":615,"props":5260,"children":5261},{},[5262],{"type":606,"tag":1107,"props":5263,"children":5264},{},[5265],{"type":612,"value":5266},"Error Handling:",{"type":606,"tag":1113,"props":5268,"children":5269},{},[5270,5275,5280,5285],{"type":606,"tag":1117,"props":5271,"children":5272},{},[5273],{"type":612,"value":5274},"Check HTTP status codes",{"type":606,"tag":1117,"props":5276,"children":5277},{},[5278],{"type":612,"value":5279},"Implement retry logic for server errors",{"type":606,"tag":1117,"props":5281,"children":5282},{},[5283],{"type":612,"value":5284},"Handle network timeouts and connection errors",{"type":606,"tag":1117,"props":5286,"children":5287},{},[5288],{"type":612,"value":5289},"Validate response data structure",{"type":606,"tag":615,"props":5291,"children":5292},{},[5293],{"type":606,"tag":1107,"props":5294,"children":5295},{},[5296],{"type":612,"value":5297},"Best Practices:",{"type":606,"tag":1113,"props":5299,"children":5300},{},[5301,5306,5311,5316],{"type":606,"tag":1117,"props":5302,"children":5303},{},[5304],{"type":612,"value":5305},"Respect rate limits and implement throttling",{"type":606,"tag":1117,"props":5307,"children":5308},{},[5309],{"type":612,"value":5310},"Use HTTPS for secure connections",{"type":606,"tag":1117,"props":5312,"children":5313},{},[5314],{"type":612,"value":5315},"Log requests for debugging",{"type":606,"tag":1117,"props":5317,"children":5318},{},[5319],{"type":612,"value":5320},"Cache responses when appropriate",{"type":606,"tag":615,"props":5322,"children":5323},{},[5324,5329],{"type":606,"tag":1107,"props":5325,"children":5326},{},[5327],{"type":612,"value":5328},"Remember:",{"type":612,"value":5330}," Always handle errors gracefully and respect API usage policies!",{"type":606,"tag":1085,"props":5332,"children":5334},{"id":5333},"whats-next",[5335],{"type":612,"value":5336},"🚀 What's Next?",{"type":606,"tag":615,"props":5338,"children":5339},{},[5340],{"type":612,"value":5341},"Learn how to work with databases to store and query structured data efficiently.",{"type":606,"tag":615,"props":5343,"children":5344},{},[5345,5350,5351],{"type":606,"tag":1107,"props":5346,"children":5347},{},[5348],{"type":612,"value":5349},"Continue to",{"type":612,"value":1735},{"type":606,"tag":5352,"props":5353,"children":5354},"a",{"href":511},[5355],{"type":612,"value":512},{"type":606,"tag":5357,"props":5358,"children":5359},"style",{},[5360],{"type":612,"value":5361},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":5363},[5364,5368,5369,5372,5373],{"id":1087,"depth":27,"text":1090,"children":5365},[5366,5367],{"id":1239,"depth":36,"text":1242},{"id":2084,"depth":36,"text":2087},{"id":3189,"depth":27,"text":3192},{"id":3336,"depth":27,"text":3339,"children":5370},[5371],{"id":3342,"depth":36,"text":3345},{"id":5210,"depth":27,"text":5213},{"id":5333,"depth":27,"text":5336},1782373763192]