Reverse Engineer HTTP request - reverse-engineering
I intercepted an HTTP request on Charles originating from iPhone to Instagram and here are the headers
POST /logging_client_events HTTP/1.1
Host: graph.instagram.com
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Connection: keep-alive
Accept: */*
User-Agent: Instagram 10.0.1 (iPhone8,1; iOS 10_1_1; en_IN; en-IN; en; scale=2.00; 750x1334) AppleWebKit/420+
Accept-Language: en-IN;q=1.0, hi-IN;q=0.9,
Content-Length: 1601
Accept-Encoding: gzip, deflate
There is a Post data as well in the request that is compressed. My question is how can I uncompress the Post data? Perhaps any method in NSData that can decompress?
EDIT: Here is the complete HTTP request
POST /logging_client_events HTTP/1.1
Host: graph.instagram.com
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Connection: keep-alive
Accept: */*
User-Agent: Instagram 10.3.0 (iPhone8,1; iOS 10_1_1; en_IN; en-IN; scale=2.00; gamut=normal; 750x1334) AppleWebKit/420+
Accept-Language: en-IN;q=1, hi-IN;q=0.9
Content-Length: 4585
Accept-Encoding: gzip, deflate
message=eNrtXG1v4kgS%2FiunfLqTAupXtzvSfiAxZInOZsmQEPt0sowxYGNj1jZDYLX326%2FaMBNICJMsZCajTUZRwO6XqvJT1c%2FTtuePE286dcP%2BydkJJgwRxgUjumCYnZyezMrjCD4VYRKcnGGmU0GIQKiKGEWUnZa9PweZ6o6qtIr%2B8U%2BmIYGEwP%2BCbv3gc%2BgH6%2BHPBdcb51rFuJCNCmsYuKJf6EZFq%2BlMN2pGDV0I6DLwkjBeuJs9Gb1gBqnXK3rDqFfAPKMi8UWtYvCaIKyGOZM16JkHeR6mk1Wf8xqqo4sGhuYNvcIouaicn2ukQhr8HLzQ5LlGlYFe4Z2c%2FeePkyTtz2JwUTkExyee8vdkHvTy1B8Hheunk0ngF65XFEEyLR6HRJOkyhETQp6eBPdFBoP%2BcTIdwxCE6IxSHWvs5M8%2FT5%2BbKBy6vwducD9N81kW7Bxdl4xvDD7M0tkUehZBXrhgZOjFysgCGrgQB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KD3OfQqIUKQNzB6%2FThhmqkHqsrHC4P5NM3UNRkOD4SGXqVUbD1fduh2g0YkxuWDQAA89VbSqzbGvx1lxgEZ2ptAI1x7nrqjcDiK4bd4DhpHoT56lYNZVPsJWPoG9UFV9QCqDiuE2uAB1v7B4f8OHH4f59GrwBw0chDnYXs5j65qKxXiyKRHI5rOOdQqwojmbk3zHcHa%2F8p6LHXMuMGtzpibUXthTR6D9Ta0uzazI8VynLGdXIV2p4nUPgiwHdS6tACw1xGwHYBQY%2BR04XPHiR3DX9qJAqpJHWNIACwwd3PRMtrcSerfBKsDx31ykzcnt9jrtsHXq5G1PA%2FNxFZAXDqJuu%2FcgLma1Insewf%2B2pHPLaPGzNX9adZS96ujIbbAt1Zpsx0O7tCbsR5ZRYKgIy5t6gU5QAyQHqxID%2FtON1FlVTABMx%2BSXPzHJBfGnHDJOOLsfSTXPVTmBQAQaH8NP1kJLq9CVelNVdWXQ%2BokbSUxVHIxc9kGMI8XZqKSq87MLlT6y%2Fa93W1je3kFssOcW0lz6VzeLCDhIAmdEFYPkBW175ZcICXU5iMcv4EVq%2F3GyaVrkqMjSgoGDeQ6u7g4ZnI9T8HK%2F0%2BASibJz7BybXMwiBaVYLxAAutU%2F1jYfuaF7Rksqzdn1OszvsqDMqFyN1N3wrOnObnGsvjWywvr3usnnv97egIq8kvOrv7vBjf4vMqVPPgdoPbn%2FwGSB1Nz&compressed=1&access_token=124024574287414%7C84a456d620314b6e92a16d8ff1c792dc&format=json
TL;DR: use the following command line to decode such messages:
ipython -c "import zlib, base64, urllib; m='<message>';zlib.decompress(base64.decodestring(urllib.unquote(m)))"
While replacing <message> with the post parameter.
Full details:
This request uses several encoders one on top of another, but all encoders used are easily recognisable by an experienced researcher and probably experienced web developer.
By the characters appearing in the message POST argument, it's easy to identify the format is base64 encoding. However, percent characters (%) stand out as they're not part of the base64 character set. After further review it is easy to see a percent sign is always followed by only a few selection of characters (%2B, %2F). These are url encoded characters (specifically '+' and '/', respectively), both part of the base64 character set.
Thus, that string should be urldecoded and then base64 decoded, and we end up getting a more cryptic string as a result, but luckily no errors:
x\xda\xed\\mo\xe2H\x12\xfe+\xa7|\xba\x93\x02\xeaW\xb7;\xd2~
<snip>
The string consists of both printable and non-printable characters, but the first two characters, x\xda (or \x78\xda) have an important meaning as they're markers for a zlib compressed stream.
For example, running that one-line with your message would look exactly like that:
nir$ ipython -c "import zlib, base64, urllib; m='eNrtXG1v4kgS%2FiunfLqTAupXtzvSfiAxZInOZsmQEPt0sowxYGNj1jZDYLX326%2FaMBNICJMsZCajTUZRwO6XqvJT1c%2FTtuePE286dcP%2BydkJJgwRxgUjumCYnZyezMrjCD4VYRKcnGGmU0GIQKiKGEWUnZa9PweZ6o6qtIr%2B8U%2BmIYGEwP%2BCbv3gc%2BgH6%2BHPBdcb51rFuJCNCmsYuKJf6EZFq%2BlMN2pGDV0I6DLwkjBeuJs9Gb1gBqnXK3rDqFfAPKMi8UWtYvCaIKyGOZM16JkHeR6mk1Wf8xqqo4sGhuYNvcIouaicn2ukQhr8HLzQ5LlGlYFe4Z2c%2FeePkyTtz2JwUTkExyee8vdkHvTy1B8Hheunk0ngF65XFEEyLR6HRJOkyhETQp6eBPdFBoP%2BcTIdwxCE6IxSHWvs5M8%2FT5%2BbKBy6vwducD9N81kW7Bxdl4xvDD7M0tkUehZBXrhgZOjFysgCGrgQBD8Og4kys4zGhhGnT8xSg06DDCaEDqUpYZq7gyDou7NB6GZBP8jD4eRg8zmjz9h%2FgJm59zk40DJJBZI7LMvSOE5nhxq3CmSRpnERTh9ZujoFneJwEjzYnAVB7IIxCzdMptkK1bss1zHBSGxYXvYBT8NC9ThDu%2ByMQ7CpnMFPZ8pYaFX220of1vOQlJT3PU2ygAVSoCDQexj7cuB5PoGBklkB1j8ayXOfzjjycjdZlC3LNp%2FDYP605ySYPz4U5u6Xo%2BD3kUMnNKy%2Fy9BxRDgl6L0GjhCKtPcYOCw1LHWpi3cbOU0I%2Bh4jxwXXpIDL%2Bl4jR%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%2FNxFZAXDqJuu%2FcgLma1Insewf%2B2pHPLaPGzNX9adZS96ujIbbAt1Zpsx0O7tCbsR5ZRYKgIy5t6gU5QAyQHqxID%2FtON1FlVTABMx%2BSXPzHJBfGnHDJOOLsfSTXPVTmBQAQaH8NP1kJLq9CVelNVdWXQ%2BokbSUxVHIxc9kGMI8XZqKSq87MLlT6y%2Fa93W1je3kFssOcW0lz6VzeLCDhIAmdEFYPkBW175ZcICXU5iMcv4EVq%2F3GyaVrkqMjSgoGDeQ6u7g4ZnI9T8HK%2F0%2BASibJz7BybXMwiBaVYLxAAutU%2F1jYfuaF7Rksqzdn1OszvsqDMqFyN1N3wrOnObnGsvjWywvr3usnnv97egIq8kvOrv7vBjf4vMqVPPgdoPbn%2FwGSB1Nz'; zlib.decompress(base64.decodestring(urllib.unquote(m)))"
Final result is:
{"app_id":"124024574287414","uid":"0","time":1483722700.043034,"app_ver":"10.3.0 (46070771)","device_id":"1B758FB6-DC9F-4FD1-8C8D-6A848DADA0C7","family_device_id":"43C4D2EE-8FDE-428D-91CA-D5A724A1549A","session_id":"BA0E0CF1-42F8-432C-BB62-2F5B48369B63","data":[{"module":"app","name":"websocket_connect_attempt","time":1483722692.504779,"extra":{"pk":"2284338164"}},{"module":"app","name":"ig_qe_exposure","time":1483722692.58945,"extra":{"group":"test_social_context_on_client","id":"2284338164","pk":"2284338164","experiment":"ig_ios_feed_ufi_redesign"}},{"module":"app","name":"ig_qe_exposure","time":1483722692.589543,"extra":{"group":"test","id":"2284338164","pk":"2284338164","experiment":"ig_ios_save"}},{"module":"app","name":"ig_qe_exposure","time":1483722692.593709,"extra":{"group":"rollout","id":"2284338164","pk":"2284338164","experiment":"ig_ios_save_feed_tooltip"}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722692.812107,"extra":{"tray_position":0,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"2284338164","has_my_reel":0,"viewed_reel_count":0,"new_reel_count":0,"is_new_reel":1}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722692.817618,"extra":{"tray_position":0,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"25025320","has_my_reel":0,"viewed_reel_count":0,"new_reel_count":0,"is_new_reel":1}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722692.822306,"extra":{"tray_position":0,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"196198987","has_my_reel":0,"viewed_reel_count":0,"new_reel_count":0,"is_new_reel":1}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722692.826773,"extra":{"tray_position":0,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"575697306","has_my_reel":0,"viewed_reel_count":0,"new_reel_count":0,"is_new_reel":1}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722692.831488,"extra":{"tray_position":0,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"290691036","has_my_reel":0,"viewed_reel_count":0,"new_reel_count":0,"is_new_reel":1}},{"module":"feed_timeline","name":"instagram_organic_sub_impression","time":1483722692.84102,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":0,"pk":"2284338164","a_pk":"1487230826","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421627016431640101_1487230826","tracking_token":"eyJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJzZXJ2ZXJfdG9rZW4iOiIxNDgzNzE0NDYyNDI2fDE0MjE2MjcwMTY0MzE2NDAxMDF8MjI4NDMzODE2NHw2YjAwZDY2NGY1NDNjZGNiOTJkOGQwYzUxMzVhYzhhOWIyZjY0YjlmYmIxNjFiNTA2NjYwODFkOWIxMDNkYmY4IiwidXVpZCI6Ijc5ZjQ2NTAyYWZkOTQ2NWVhYmVjZmQzNWM1NzU0YjI2MTQyMTYyNzAxNjQzMTY0MDEwMSJ9LCJ2ZXJzaW9uIjo1fQ==","follow_status":"following"}},{"module":"app","name":"ig_qe_exposure","time":1483722692.841793,"extra":{"group":"TEST","id":"2284338164","pk":"2284338164","experiment":"ig_ios_feed_video_cell_autoplay_bugfix"}},{"module":"device","name":"connection_change","time":1483722692.899129,"extra":{"pk":"2284338164","connection":"wifi","connection_subtype":"CTRadioAccessTechnologyHSDPA"}},{"module":"application","name":"launch_usable","time":1483722692.932535,"extra":{"device":"iPhone8,1","os":"10.1.1","init_to_launch_ms":159.7147916691029,"pk":"2284338164","init_to_now_ms":1051.190583333664,"background_init":false,"init_to_active_ms":617.7668750024168,"init_to_usable_ms":891.4757916645613}},{"module":"application","name":"push_notification_setting","time":1483722692.940062,"extra":{"badges":true,"alerts":true,"sounds":true,"pk":"2284338164","app_state":"launch_usable","badge_number":0,"last_badge_number":0,"raw_setting":7}},{"module":"app","name":"direct_ui_perf","time":1483722692.971275,"extra":{"first_page":true,"result":"success","pk":"2284338164","view":"inbox","type":"request_time","total_duration":695}},{"module":"app","name":"realtime_subscribe_attempt","time":1483722692.976333,"extra":{"realtime_topic":"user-ds2-2284338164~2","pk":"2284338164","realtime_subscription_already_exists":false}},{"module":"app","name":"content_loaded","time":1483722692.984203,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.1976552499982063,"content_width":750}},{"module":"app","name":"websocket_did_open","time":1483722693.956506,"extra":{"pk":"2284338164"}},{"module":"app","name":"realtime_subscribed","time":1483722694.343897,"extra":{"pk":"2284338164","realtime_topic":"user-ds2-2284338164~2"}},{"module":"feed_timeline","name":"reel_tray_refresh","time":1483722694.437768,"extra":{"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","was_successful":true,"muted_reel_count":0,"tray_refresh_type":"network","viewed_reel_count":0,"new_reel_count":9,"tray_refresh_time":0.4671275000000605,"has_my_reel":1}},{"module":"feed_timeline","name":"reel_tray_impression","time":1483722694.451732,"extra":{"tray_position":3,"pk":"2284338164","live_reel_count":0,"tray_session_id":"4ba09935da694e4e970ee8b11c9faac2","muted_reel_count":0,"a_pk":"1573917928","has_my_reel":1,"viewed_reel_count":0,"new_reel_count":9,"is_new_reel":1}},{"module":"feed_timeline","name":"instagram_main_feed_refresh","time":1483722694.63361,"extra":{"reason":"cold_start_fetch","pk":"2284338164","status_code":"200"}},{"module":"app","name":"app_installations","time":1483722694.8347,"extra":{"pk":"2284338164","fbapp_installed":true}},{"module":"feed_timeline","name":"instagram_organic_impression","time":1483722695.036799,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":0,"pk":"2284338164","a_pk":"2263699430","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421834952577120803_2263699430","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTgzNDk1MjU3NzEyMDgwM3wyMjg0MzM4MTY0fDEyNTgxMjQ3ODdmYWMzODA5N2RkM2M4MjhlNWUxNGFjMjcyOTUzNGRiMDVhNzk5NTViOTc0NWFjNGEwNTUxMGMiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTgzNDk1MjU3NzEyMDgwMyJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_time_spent","time":1483722695.036946,"extra":{"source_of_action":"feed_timeline","m_t":1,"pk":"2284338164","a_pk":"1487230826","timespent":2.195435047149658,"m_pk":"1421627016431640101_1487230826","tracking_token":"eyJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJzZXJ2ZXJfdG9rZW4iOiIxNDgzNzE0NDYyNDI2fDE0MjE2MjcwMTY0MzE2NDAxMDF8MjI4NDMzODE2NHw2YjAwZDY2NGY1NDNjZGNiOTJkOGQwYzUxMzVhYzhhOWIyZjY0YjlmYmIxNjFiNTA2NjYwODFkOWIxMDNkYmY4IiwidXVpZCI6Ijc5ZjQ2NTAyYWZkOTQ2NWVhYmVjZmQzNWM1NzU0YjI2MTQyMTYyNzAxNjQzMTY0MDEwMSJ9LCJ2ZXJzaW9uIjo1fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_sub_viewed_impression","time":1483722695.036983,"extra":{"source_of_action":"feed_timeline","follow_status":"following","m_t":1,"a_pk":"1487230826","m_pk":"1421627016431640101_1487230826","pk":"2284338164","tracking_token":"eyJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7ImlzX2FuYWx5dGljc190cmFja2VkIjp0cnVlLCJzZXJ2ZXJfdG9rZW4iOiIxNDgzNzE0NDYyNDI2fDE0MjE2MjcwMTY0MzE2NDAxMDF8MjI4NDMzODE2NHw2YjAwZDY2NGY1NDNjZGNiOTJkOGQwYzUxMzVhYzhhOWIyZjY0YjlmYmIxNjFiNTA2NjYwODFkOWIxMDNkYmY4IiwidXVpZCI6Ijc5ZjQ2NTAyYWZkOTQ2NWVhYmVjZmQzNWM1NzU0YjI2MTQyMTYyNzAxNjQzMTY0MDEwMSJ9LCJ2ZXJzaW9uIjo1fQ=="}},{"module":"app","name":"content_loaded","time":1483722695.558961,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.8762567916637636,"content_width":750}},{"module":"app","name":"content_loaded","time":1483722695.576639,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.400949374998163,"content_width":750}},{"module":"feed_timeline","name":"instagram_organic_impression","time":1483722696.305709,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":1,"pk":"2284338164","a_pk":"204327608","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421889687605301135_204327608","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTg4OTY4NzYwNTMwMTEzNXwyMjg0MzM4MTY0fDY5ZTgwODY2NzkwMWU1YTdiMGEwM2NkYTRlNmQyYzNjNjNkY2M3NTZjMDIwNzE1OGQ2YTc0NTE1NDZhZjQ2OGIiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTg4OTY4NzYwNTMwMTEzNSJ9fQ==","follow_status":"following"}},{"module":"hscroll_aymf_feed_unit","name":"recommended_user_impression","time":1483722696.32221,"extra":{"pk":"2284338164","uid":"2316545717","view":"hscroll_aymf_feed_unit","position":0,"algorithm":"followers_algorithm"}},{"module":"hscroll_aymf_feed_unit","name":"recommended_user_impression","time":1483722696.326252,"extra":{"pk":"2284338164","uid":"3896352675","view":"hscroll_aymf_feed_unit","position":1,"algorithm":"followers_algorithm"}},{"module":"hscroll_aymf_feed_unit","name":"recommended_user_impression","time":1483722696.329706,"extra":{"pk":"2284338164","uid":"2942400495","view":"hscroll_aymf_feed_unit","position":2,"algorithm":"page_rank_algorithm"}},{"module":"app","name":"content_loaded","time":1483722696.490827,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.0478957499981334,"content_width":799}},{"module":"feed_timeline","name":"instagram_organic_time_spent","time":1483722697.295841,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":0,"pk":"2284338164","a_pk":"2263699430","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","timespent":2.258677005767822,"m_pk":"1421834952577120803_2263699430","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTgzNDk1MjU3NzEyMDgwM3wyMjg0MzM4MTY0fDEyNTgxMjQ3ODdmYWMzODA5N2RkM2M4MjhlNWUxNGFjMjcyOTUzNGRiMDVhNzk5NTViOTc0NWFjNGEwNTUxMGMiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTgzNDk1MjU3NzEyMDgwMyJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_viewed_impression","time":1483722697.296037,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":0,"pk":"2284338164","a_pk":"2263699430","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421834952577120803_2263699430","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTgzNDk1MjU3NzEyMDgwM3wyMjg0MzM4MTY0fDEyNTgxMjQ3ODdmYWMzODA5N2RkM2M4MjhlNWUxNGFjMjcyOTUzNGRiMDVhNzk5NTViOTc0NWFjNGEwNTUxMGMiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTgzNDk1MjU3NzEyMDgwMyJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_impression","time":1483722697.422587,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":2,"pk":"2284338164","a_pk":"290691036","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421785804972142074_290691036","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTc4NTgwNDk3MjE0MjA3NHwyMjg0MzM4MTY0fDNjMDFkMWQ4N2I1YmFiZTcxYTFhYjhkMDgwNTRhYzg5ZWFiODkwZGRiNTlmODkwNjNjOTVkYWU0ZDJjMWM2MTUiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTc4NTgwNDk3MjE0MjA3NCJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_time_spent","time":1483722697.557526,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":1,"pk":"2284338164","a_pk":"204327608","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","timespent":1.185648024082184,"m_pk":"1421889687605301135_204327608","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTg4OTY4NzYwNTMwMTEzNXwyMjg0MzM4MTY0fDY5ZTgwODY2NzkwMWU1YTdiMGEwM2NkYTRlNmQyYzNjNjNkY2M3NTZjMDIwNzE1OGQ2YTc0NTE1NDZhZjQ2OGIiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTg4OTY4NzYwNTMwMTEzNSJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_viewed_impression","time":1483722697.557715,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":1,"pk":"2284338164","a_pk":"204327608","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421889687605301135_204327608","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTg4OTY4NzYwNTMwMTEzNXwyMjg0MzM4MTY0fDY5ZTgwODY2NzkwMWU1YTdiMGEwM2NkYTRlNmQyYzNjNjNkY2M3NTZjMDIwNzE1OGQ2YTc0NTE1NDZhZjQ2OGIiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTg4OTY4NzYwNTMwMTEzNSJ9fQ==","follow_status":"following"}},{"module":"app","name":"content_loaded","time":1483722697.578529,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.02764237500014133,"content_width":612}},{"module":"app","name":"ig_qe_exposure","time":1483722698.19705,"extra":{"group":"test","id":"2284338164","pk":"2284338164","experiment":"ig_ios_ad_new_sponsored_label_universe"}},{"module":"app","name":"ig_qe_exposure","time":1483722698.227725,"extra":{"group":"test","id":"2284338164","pk":"2284338164","experiment":"ig_ios_video_corrected_viewport_logging"}},{"module":"app","name":"content_loaded","time":1483722698.33762,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.04629112499969779,"content_width":750}},{"module":"app","name":"ig_qe_exposure","time":1483722698.457056,"extra":{"group":"test","id":"2284338164","pk":"2284338164","experiment":"ig_ios_ad_intent_to_highlight_universe"}},{"module":"feed_timeline","name":"instagram_organic_time_spent","time":1483722698.522836,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":2,"pk":"2284338164","a_pk":"290691036","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","timespent":0.991282045841217,"m_pk":"1421785804972142074_290691036","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5NzZ8MTQyMTc4NTgwNDk3MjE0MjA3NHwyMjg0MzM4MTY0fDNjMDFkMWQ4N2I1YmFiZTcxYTFhYjhkMDgwNTRhYzg5ZWFiODkwZGRiNTlmODkwNjNjOTVkYWU0ZDJjMWM2MTUiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6dHJ1ZSwidXVpZCI6ImE3MGIyZjIxNzNmZjQzMWNhMjdmNjFlMjdiNzk0MDgwMTQyMTc4NTgwNDk3MjE0MjA3NCJ9fQ==","follow_status":"following"}},{"module":"feed_timeline","name":"instagram_organic_impression","time":1483722698.605625,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":4,"pk":"2284338164","a_pk":"2082772377","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421886268559992426_2082772377","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5Nzd8MTQyMTg4NjI2ODU1OTk5MjQyNnwyMjg0MzM4MTY0fDViYWY4YjEwM2ZkYmJiYTI0MjcyNmQ0OGNkMDRjY2MzNmFhZWRjYTZlZDczYmNjOTM3ZDg2MjA2OTIyODQ5ZmEiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6ZmFsc2UsInV1aWQiOiJhNzBiMmYyMTczZmY0MzFjYTI3ZjYxZTI3Yjc5NDA4MDE0MjE4ODYyNjg1NTk5OTI0MjYifX0=","follow_status":"following"}},{"module":"app","name":"content_loaded","time":1483722699.07202,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.02502862500114134,"content_width":750}},{"module":"feed_timeline","name":"instagram_organic_impression","time":1483722699.747028,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":5,"pk":"2284338164","a_pk":"2082772377","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","m_pk":"1421886211525945054_2082772377","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5Nzd8MTQyMTg4NjIxMTUyNTk0NTA1NHwyMjg0MzM4MTY0fGJiNTRhMDkwNzg3ZmQ5ZTg0Mjc4MzQ5NDkyMmRjY2E4MWJjMGQxYWQ1YzJiMGMwNmIzZGUyYTZkMDZiYjhhZjAiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6ZmFsc2UsInV1aWQiOiJhNzBiMmYyMTczZmY0MzFjYTI3ZjYxZTI3Yjc5NDA4MDE0MjE4ODYyMTE1MjU5NDUwNTQifX0=","follow_status":"following"}},{"module":"app","name":"content_loaded","time":1483722699.869509,"extra":{"content_type":"photo","pk":"2284338164","content_load_time":0.0443396250011574,"content_width":750}},{"module":"feed_timeline","name":"instagram_organic_time_spent","time":1483722700.039492,"extra":{"source_of_action":"feed_timeline","m_t":1,"m_ix":4,"pk":"2284338164","a_pk":"2082772377","session_id":"2284338164_22006D1E-0336-4815-9429-A49B7EC70FD6","timespent":0.9339390397071838,"m_pk":"1421886268559992426_2082772377","tracking_token":"eyJ2ZXJzaW9uIjo1LCJzaWduYXR1cmUiOiIiLCJwYXlsb2FkIjp7InNlcnZlcl90b2tlbiI6IjE0ODM3MjI2OTM5Nzd8MTQyMTg4NjI2ODU1OTk5MjQyNnwyMjg0MzM4MTY0fDViYWY4YjEwM2ZkYmJiYTI0MjcyNmQ0OGNkMDRjY2MzNmFhZWRjYTZlZDczYmNjOTM3ZDg2MjA2OTIyODQ5ZmEiLCJpc19hbmFseXRpY3NfdHJhY2tlZCI6ZmFsc2UsInV1aWQiOiJhNzBiMmYyMTczZmY0MzFjYTI3ZjYxZTI3Yjc5NDA4MDE0MjE4ODYyNjg1NTk5OTI0MjYifX0=","follow_status":"following"}},{"module":"feed_timeline","name":"perf_percent_photos_rendered","time":1483722700.03977,"extra":{"pk":"2284338164","rendered":true}}],"log_type":"client_event","seq":0}
You can use gzuncompress in php :
https://secure.php.net/manual/fr/function.gzuncompress.php
<?php
$compressed = gzcompress('Compresse moi', 9); // or $compressed = "YOUrcOmpreSSedStRINg";
$uncompressed = gzuncompress($compressed);
echo $uncompressed;
?>
Related
XMLHttpRequest Header : Decode Binary Data Upon Server Arrival
I am building a multipart/form-data httprequest, using Javascript's XMLHttpRequest object. Here are the headers: Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5 Content-Length: 38539 Content-Type: multipart/form-data; charset=UTF-8; boundary=CONTENT_BOUNDARY Cookie: __utma=111872281.167592067.1396133699.1396133699.1396133699.1; PHPSESSID=ea7cfjgi8e29v1bhnrj580vbc2 DNT: 1 Host: localhost:90 Referer: localhost:90/my_secret_referer/no_peeking.php User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 I send the request to a PHP document. In the following snippet one can observe a part of the request body. It details the transmission of binary data in base64 representing an image file that has been selected. --CONTENT_BOUNDARY Content-Disposition: form-data; name="images[]"; filename="airplane.jpg" Content-Type: image/jpeg Content-Transfer-Encoding: base64 .../9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDABkRExYTEBkWFBYcGxkeJT4pJSIiJUw3Oi0... This body part cooperates with the entire request to create a successful AJAX request to my server. When the information arrives at the server, I decode the information and do what I may with it. The segment of this process that I am unsatisfied with is the manual decoding of the binary data. One is always able to receive uploaded images in the server as complete, legible image files when using jQuery's $.ajax() or Malsup's jQuery Form. I have looked into the format of the two mentioned requests and have found that they too send binary information using a multipart/form-data request. The one difference that I have found which I have not intentionally made is that my request is furnished with a charset: utf8; specification inside of the Content-Type after I send it. Can I, and if I can, how can I tell the server to decode the binary information it receives?
YouTrack API Form Data Description
I am trying to send the description in form data to create an issue but it seems it is only possible through parameters with a length restriction. Does anybody know a way around this or am I doing something wrong? PUT /rest/issue?project=LSDebug&summary=Debug%2520Log HTTP/1.1 Connection: keep-alive Content-Length: 266 Accept: application/json, text/plain, */* Origin: http://localhost:8080 Content-Type: application/x-www-form-urlencoded Referer: http://localhost:8080/index.html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-GB,en-US;q=0.8,en;q=0.6 Query String Parameters project:LSDebug summary:Debug%20Log Form Data description=Submitted%20Form%20name%3A%20null%2C%20Id%3Anull%0D%0AInput%20name%3A%20null%2C%20Id%3Anull%2C%20NgModel%3Aresult.homeTeamScore.score%2C%20Value%3A%201%0D%0AInput%20name%3A%20null%2C%20Id%3Anull%2C%20NgModel%3Aresult.awayTeamScore.score%2C%20Value%3A%202
I think you need to embed the data in XML within the body of your PUT request as documented in the Import REST API docs.
Html forms only support GET or POST. So i would suggest you to post the form data using POST method instead of PUT. So that the form content will go into the body of the message and you will able to evade the URL restriction
How can I put Google Drive API files.list requests for different users in the same batch request?
Normally, one would use BatchHttpRequest to aggregate several requests, but what if I want to list files for two different users? Nominally that requires an oauth2 token per-user. BatchHttpRequest either takes one http object (which handles the credentials) for the batch, or pulls it out of the first batched request encountered when .execute() is called. Using oauth1 to sign each batched requests results in proper results (different feeds for each user). However, using oauth2 and manually constructing the payload results in identical feeds (matching the user in the first batched request): POST /batch HTTP/1.1 Host: www.googleapis.com Content-Type: multipart/mixed; boundary=blah Content-Length: 572 accept-encoding: gzip, deflate Cache-Control: no-cache --blah Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: <b29c5de2-0db4-490b-b421-6a51b598bd22+1> GET /drive/v2/changes HTTP/1.1 Authorization: Bearer ya29.UQAabvlG2hnRPyEAAADUm7vkDe_qg7L49R655IyxvgBnkN7_PEgE3IG7UnZ_ZEmJwUK_6fSV4kTHjNQIjTk accept: application/json --blah Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: <b29c5de2-0db4-490b-b421-6a51b598bd22+2> GET /drive/v2/changes HTTP/1.1 Authorization: Bearer ya29.UQBu8f9W8S5E6RwAAAAPqCOiqoFW3QEFYkBvQGx36UVKNHeEhdZT8GPN-P74ng accept: application/json --blah Since oauth1 works, it seems that this is at least theoretically possible, although I may be blocked by a google bug where the oauth2 token for the first request in the batch overrides any other authorizations included.
The google-provided client does not support this, but providing an Authorization header for each request will work. The example given should work assuming all of the authorization header values are correct.
Get http post request body in perl
Request header (from Firebug): Accept application/json, text/plain, */* Accept-Encoding gzip, deflate Content-Type application/json;charset=utf-8 Request json: {"key":"value"} So how to get request body in perl?
What webserver? Usually POST data is available by simply reading from STDIN. If you are using the venerable CGI module (under mod_perl or not), you can get the body via: $cgi->param('POSTDATA') (if, as in this case, the content type isn't application/x-www-form-urlencoded or multipart/form-data)
multipart/mixed HTTP request in actionscript
Is there an easy way to make an multipart/mixed HTTP request in as3? I'm trying to reach LightSwitch server using OData protocol from flash. To send multiple commands at once you can combine them in one batch using HTTP request with "multipart/mixed" content type. Here an example of HTTP requests with two commands: Content-Type:multipart/mixed; boundary=batch --batch Content-Type: multipart/mixed; boundary=changeset --changeset Content-Type: application/http Content-Transfer-Encoding: binary PUT http://localhost:18065/ApplicationData.svc/Orders(3)/$links/User HTTP/1.1 Content-Type: application/json;odata=verbose {"uri": "http://localhost:18065/ApplicationData.svc/Users(4)"} --changeset Content-Type: application/http Content-Transfer-Encoding: binary MERGE http://localhost:18065/ApplicationData.svc/Users(3) HTTP/1.1 Content-Type: application/json;odata=verbose If-Match: W/"X'0000000000002715'" {"Name": "User 3_"} --changeset-- --batch-- Every part contains own HTTP headers and body. Response formatted the same way, with own http response code. How to work with multiple HTTP requests in actionscript?