David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
Mark Slee | 9f0c651 | 2007-02-28 23:58:26 +0000 | [diff] [blame] | 19 | |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 20 | #ifndef _THRIFT_TRANSPORT_THTTPCLIENT_H_ |
| 21 | #define _THRIFT_TRANSPORT_THTTPCLIENT_H_ 1 |
| 22 | |
David Reiss | 112e309 | 2010-08-12 23:03:29 +0000 | [diff] [blame] | 23 | #include <transport/THttpTransport.h> |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 24 | |
T Jake Luciani | b5e6221 | 2009-01-31 22:36:20 +0000 | [diff] [blame] | 25 | namespace apache { namespace thrift { namespace transport { |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 26 | |
David Reiss | 112e309 | 2010-08-12 23:03:29 +0000 | [diff] [blame] | 27 | class THttpClient : public THttpTransport { |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 28 | public: |
| 29 | THttpClient(boost::shared_ptr<TTransport> transport, std::string host, std::string path=""); |
| 30 | |
| 31 | THttpClient(std::string host, int port, std::string path=""); |
| 32 | |
| 33 | virtual ~THttpClient(); |
| 34 | |
David Reiss | 112e309 | 2010-08-12 23:03:29 +0000 | [diff] [blame] | 35 | virtual void flush(); |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 36 | |
| 37 | protected: |
| 38 | |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 39 | std::string host_; |
| 40 | std::string path_; |
| 41 | |
David Reiss | 112e309 | 2010-08-12 23:03:29 +0000 | [diff] [blame] | 42 | virtual void parseHeader(char* header); |
| 43 | virtual bool parseStatusLine(char* status); |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 44 | |
| 45 | }; |
| 46 | |
T Jake Luciani | b5e6221 | 2009-01-31 22:36:20 +0000 | [diff] [blame] | 47 | }}} // apache::thrift::transport |
Mark Slee | 8a98e1b | 2007-02-27 05:16:23 +0000 | [diff] [blame] | 48 | |
| 49 | #endif // #ifndef _THRIFT_TRANSPORT_THTTPCLIENT_H_ |