Installing and using Linux CURL

Source: Internet
Author: User
Tags command line curl json linux

--Get installation packages, download directly from the Internet or other channels, direct wget here

# wget http://curl.haxx.se/download/curl-7.17.1.tar.gz

--Extract to current directory

# TAR-ZXF Curl-7.17.1.tar.gz

--Into the unpacked directory

# CD curl-7.17.1

--Configure, specify the installed directory, this is "/usr/local/curl"

#./configure--prefix=/usr/local/curl

--

# make

--Installation

# make Install

--Installation Complete

Use:

Add the Curl command to the environment variable,

Command line (only for this session, or to configure environment variables in. bash_profile,. bashrc files):

# Export path= $PATH:/usr/local/curl/bin

And then you can use the

# Curl Http://www.baidu.com

Come out a lot of HTML code, is Baidu homepage code

Instructions for getting Started:

http://www.javaeye.com/topic/648143

-------------------------------------------------------------------------------------------

Use instance (send POST request):

# curl-d @json Http://www.google.com/loc/json

-d--is sending the request as Post

@json--@ reads data from a file, the content in the JSON file is {"Address_language": "Zh_cn", "cell_towers": [{"cell_id": "36526", "Location_area_code ":" 14556 "," Mobile_contry_code ":" 460 "," Mobile_network_code ":" "," "Host": "Maps.google.com", "location": null, " Request_address ": True," version ":" 1.1.0 "," wifi_towers ": []}

Return:

{"Location": {"latitude": 32.117302, "longitude": 114.116598, "address": {"Country": "China", "Country_code": "CN", "region" ":" Henan Province "," City ":" Xinyang "}," accuracy ": 1625.0}," Access_token ":" 2:FAXK0XL_DHRBCQIK:5TGTJSZX1SCPJUFJ "}

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.