weatherdemo2
所属分类:救灾/预报
开发工具:Swift
文件大小:82KB
下载次数:0
上传日期:2016-04-29 09:32:41
上 传 者:
sh-1993
说明: iOS网络编程双神器demo-天气 by 小波
(IOS network programming double artifact demo weather by wavelet)
文件列表:
Podfile (27, 2016-04-29)
Podfile.lock (132, 2016-04-29)
Pods (0, 2016-04-29)
Pods\Headers (0, 2016-04-29)
Pods\Headers\Private (0, 2016-04-29)
Pods\Headers\Private\Just (0, 2016-04-29)
Pods\Headers\Private\Just\Just.h (25, 2016-04-29)
Pods\Just (0, 2016-04-29)
Pods\Just\Just (0, 2016-04-29)
Pods\Just\Just\Just.h (303, 2016-04-29)
Pods\Just\Just\Just.swift (38446, 2016-04-29)
Pods\Just\LICENSE.md (1084, 2016-04-29)
Pods\Manifest.lock (132, 2016-04-29)
Pods\Pods.xcodeproj (0, 2016-04-29)
Pods\Pods.xcodeproj\project.pbxproj (33339, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata (0, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata\xiaobo.xcuserdatad (0, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata\xiaobo.xcuserdatad\xcschemes (0, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata\xiaobo.xcuserdatad\xcschemes\Just.xcscheme (2078, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata\xiaobo.xcuserdatad\xcschemes\Pods.xcscheme (2078, 2016-04-29)
Pods\Pods.xcodeproj\xcuserdata\xiaobo.xcuserdatad\xcschemes\xcschememanagement.plist (648, 2016-04-29)
Pods\Target Support Files (0, 2016-04-29)
Pods\Target Support Files\Just (0, 2016-04-29)
Pods\Target Support Files\Just\Info.plist (847, 2016-04-29)
Pods\Target Support Files\Just\Just-dummy.m (112, 2016-04-29)
Pods\Target Support Files\Just\Just-prefix.pch (48, 2016-04-29)
Pods\Target Support Files\Just\Just-umbrella.h (147, 2016-04-29)
Pods\Target Support Files\Just\Just.modulemap (98, 2016-04-29)
Pods\Target Support Files\Just\Just.xcconfig (266, 2016-04-29)
Pods\Target Support Files\Pods (0, 2016-04-29)
Pods\Target Support Files\Pods\Info.plist (847, 2016-04-29)
Pods\Target Support Files\Pods\Pods-acknowledgements.markdown (1227, 2016-04-29)
Pods\Target Support Files\Pods\Pods-acknowledgements.plist (2054, 2016-04-29)
Pods\Target Support Files\Pods\Pods-dummy.m (112, 2016-04-29)
Pods\Target Support Files\Pods\Pods-frameworks.sh (3510, 2016-04-29)
Pods\Target Support Files\Pods\Pods-resources.sh (4622, 2016-04-29)
Pods\Target Support Files\Pods\Pods-umbrella.h (130, 2016-04-29)
Pods\Target Support Files\Pods\Pods.debug.xcconfig (488, 2016-04-29)
... ...
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods](https://img.shields.io/cocoapods/v/Just.svg)](https://cocoapods.org/pods/Just)
[![Build Status](https://travis-ci.org/JustHTTP/Just.svg?branch=swift-2.0)](https://travis-ci.org/JustHTTP/Just)
![MIT License](https://img.shields.io/cocoapods/l/Just.svg)
![Supported Flatform](https://img.shields.io/cocoapods/p/Just.svg)
Just is a client-side HTTP library inspired by [python-requests][] - HTTP for Humans.
Just requires Swift 2.
*Follow [@JustHTTP][twitter] for updates, if you are into that kind of things* ‰
[python-requests]: http://python-requests.org "python-requests"
[twitter]: https://twitter.com/JustHTTP
# Features
Just lets you to the following effortlessly:
- URL queries
- custom headers
- form (`x-www-form-encoded`) / JSON HTTP body
- redirect control
- multipart file upload along with form values.
- basic/digest authentication
- cookies
- timeouts
- synchronous / asynchronous requests
- upload / download progress tracking for asynchronous requests
- link headers
- friendly accessible results
# Use
The simplest request with Just looks like this:
```swift
// A simple get request
Just.get("http://httpbin.org/get")
```
The next example shows how to upload a file along with some data:
```swift
// talk to registration end point
let r = Just.post(
"http://justiceleauge.org/member/register",
data: ["username": "barryallen", "password":"ReverseF1ashSucks"],
files: ["profile_photo": .URL(fileURLWithPath:"flash.jpeg", nil)]
)
if (r.ok) { /* success! */ }
```
Here's the same example done asynchronously:
```swift
// talk to registration end point
Just.post(
"http://justiceleauge.org/member/register",
data: ["username": "barryallen", "password":"ReverseF1ashSucks"],
files: ["profile_photo": .URL(fileURLWithPath:"flash.jpeg", nil)]
) { (r)
if (r.ok) { /* success! */ }
}
```
Read *Getting Started* [on the web][starting link] or
[in this playground][starting playground] to learn more!
[starting playground]: https://github.com/JustHTTP/Just/raw/master/Docs/QuickStart.zip
[starting link]: http://docs.justhttp.net/QuickStart.html
# Install
Here are some ways to leverage Just.
## Carthage (recommended)
Include the following in your Cartfile:
github "JustHTTP/Just"
Just includes dynamic framework targets for both iOS and OS X.
## CocoaPods
The usual way:
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'Just'
end
## Manual
Drop `Just.xcodeproj` into your project navigator. Under the *General* tab of
your project settings, use the plus sign to add `Just.framework` to
*Linked Framework and Libraries*. Make sure to include the correct version
for your target's platform.
It's also common to add Just as a git submodule to your projects repository:
cd path/to/your/project
git submodule add https://github.org/JustHTTP/Just.git
## Source File
Put `Just.swift` directly into your project. Alternately, put it in the
*Sources* folder of a playground. (The latter makes a fun way to explore the
web.)
[Carthage]: https://github.com/Carthage/Carthage "Carthage"
# Contribute
Pull requests are welcome. Here are some tips for code contributors:
Work in `Just.xcworkspace`.
Tests requires [Quick][], which is a submodule to this repository. Make sure
you run the following before attempting to test:
git submodule update --init --recursive
For Xcode rebels, checkout `Makefile` (you'll need [xcpretty][]).
HTML documentation pages are generated by literate programmin tool [docco][]
[Quick]: https://github.com/Quick/Quick "Quick"
[xcpretty]: https://github.com/supermarin/xcpretty "xcpretty"
[docco]: http://jashkenas.github.io/docco/ "docco"
# License
MIT, see [LICENSE.md](https://github.com/JustHTTP/Just/blob/master/LICENSE.md).
近期下载者:
相关文件:
收藏者: