如何执行curl字符串请求

时间:2015-08-02 06:15:59

标签: php curl

我已经将mozilla firefox的帖子提交复制并修改为curl请求。 这是我的输出:

curl 'http://localhost/huvy/searchreplacedb2.php?step=5&ext=1' -H 'Pragma: no-cache' -H 'Origin: http://localhost' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,he;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/43.0.2357.130 Chrome/43.0.2357.130 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost/huvy/searchreplacedb2.php' -H 'Cookie: wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_85ad34d540f49584962c47bd5de75f3a=aryeh%7C1437719285%7C1fzxnO6tG4khwMrhx58E2PJynM9wtHRO0211Ip0RZSC%7C4004faae723b7c9898f51b4bf79c0077fb5e36956bf0a6c4b94dda35ff50e00e; wp-settings-1=editor%3Dtinymce%26libraryContent%3Dbrowse; wp-settings-time-1=1437546486; woocommerce_recently_viewed=34%7C51%7C2372%7C2529%7C2375%7C54%7C2483%7C2528; _icl_current_language=en; _ga=GA1.1.974022963.1437554350' -H 'Connection: keep-alive' --data '; host=10.0.0.12&data=huvy&user=root&pass=&char=utf8mb4&guid=0&tables%5B0%5D=uv_commentmeta&tables%5B1%5D=uv_comments&tables%5B2%5D=uv_icl_content_status&tables%5B3%5D=uv_icl_core_status&tables%5B4%5D=uv_icl_flags&tables%5B5%5D=uv_icl_languages&tables%5B6%5D=uv_icl_languages_translations&tables%5B7%5D=uv_icl_locale_map&tables%5B8%5D=uv_icl_message_status&tables%5B9%5D=uv_icl_node&tables%5B10%5D=uv_icl_reminders&tables%5B11%5D=uv_icl_string_packages&tables%5B12%5D=uv_icl_string_positions&tables%5B13%5D=uv_icl_string_status&tables%5B14%5D=uv_icl_string_translations&tables%5B15%5D=uv_icl_strings&tables%5B16%5D=uv_icl_translate&tables%5B17%5D=uv_icl_translate_job&tables%5B18%5D=uv_icl_translation_batches&tables%5B19%5D=uv_icl_translation_status&tables%5B20%5D=uv_icl_translations&tables%5B21%5D=uv_links&tables%5B22%5D=uv_options&tables%5B23%5D=uv_postmeta&tables%5B24%5D=uv_posts&tables%5B25%5D=uv_term_relationships&tables%5B26%5D=uv_term_taxonomy&tables%5B27%5D=uv_terms&tables%5B28%5D=uv_usermeta&tables%5B29%5D=uv_users&tables%5B30%5D=uv_woocommerce_attribute_taxonomies&tables%5B31%5D=uv_woocommerce_downloadable_product_permissions&tables%5B32%5D=uv_woocommerce_order_itemmeta&tables%5B33%5D=uv_woocommerce_order_items&tables%5B34%5D=uv_woocommerce_tax_rate_locations&tables%5B35%5D=uv_woocommerce_tax_rates&tables%5B36%5D=uv_woocommerce_termmeta&srch=huvy2&rplc=localhost/huvy' --compressed

我想用php执行这个脚本。但是curl_exec()函数需要某种Curl会话。 有什么办法可以把它作为字符串执行吗? 如果不是我将如何将其转换为卷曲会话?

0 个答案:

没有答案