-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from hildrum/httpFunc
httpPost, httpGet, and httpPut
- Loading branch information
Showing
16 changed files
with
688 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
com.ibm.streamsx.inet/com.ibm.streamsx.inet.http/native.function/function.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="ASCII"?> | ||
<function:functionModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:function="http://www.ibm.com/xmlns/prod/streams/spl/function"> | ||
<function:functionSet> | ||
<function:headerFileName>httpFunctions.h</function:headerFileName> | ||
<function:cppNamespaceName>com_ibm_streamsx_inet_http</function:cppNamespaceName> | ||
<function:functions> | ||
<function:function> | ||
<function:description>HTTP GET on the given url, using the username and password, if present. It follows redirects. If there is an error, a non-zero is returned by error.</function:description> | ||
<function:prototype cppName="">public rstring httpGet(rstring url,list<rstring> extraHeaders, rstring user, rstring password, mutable int32 error)</function:prototype> | ||
</function:function> | ||
<function:function> | ||
<function:description>HTTP DELETE on the given url, using the username and password, if present. It follows redirects. If there is an error, a non-zero is returned by error.</function:description> | ||
<function:prototype cppName="">public rstring httpDelete(rstring url,list<rstring> extraHeaders, rstring user, rstring password, mutable int32 error)</function:prototype> | ||
</function:function> | ||
<function:function> | ||
<function:description>HTTP PUT data to the given url using the username and password given if not empty. Does not follow redirects. Headers are returned in the headers list, error is set to a non-zero if there is an error, and the result of the PUT is returned in the rstring.</function:description> | ||
<function:prototype>public rstring httpPut(rstring data, rstring url, list<rstring> extraHeaders, rstring username, rstring password, mutable list<rstring> headers, mutable int32 error)</function:prototype> | ||
</function:function> | ||
<function:function> | ||
<function:description>HTTP POST data to the given url using the username and password (if non-empty). Does not follow redirects. Headers are returned in the headers list. Error is set to non-zero if there is an error. The result of the POST is returned as an rstring. </function:description> | ||
<function:prototype>public rstring httpPost(rstring data, rstring url, list<rstring> extraHeaders, rstring username, rstring password, mutable list<rstring> headers, mutable int32 error)</function:prototype> | ||
</function:function> | ||
<function:function> | ||
<function:description>Decode a URL encoded rstring.</function:description> | ||
<function:prototype>public rstring urlDecode(rstring decode)</function:prototype> | ||
</function:function> | ||
<function:function> | ||
<function:description>URL encode the given rstring.</function:description> | ||
<function:prototype>public rstring urlEncode(rstring raw)</function:prototype> | ||
</function:function> | ||
</function:functions> | ||
<function:dependencies> | ||
<function:library> | ||
<common:description></common:description> | ||
<common:managedLibrary> | ||
<common:lib>curl</common:lib> | ||
<common:lib>inettoolkit</common:lib> | ||
<common:libPath>../../impl/lib</common:libPath> | ||
<common:includePath>../../impl/cpp/include</common:includePath> | ||
</common:managedLibrary> | ||
</function:library> | ||
</function:dependencies> | ||
</function:functionSet> | ||
</function:functionModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef HTTP_FOR_STREAMS | ||
#define HTTP_FOR_STREAMS | ||
#include "curl/curl.h" | ||
#include <SPL/Runtime/Type/Blob.h> | ||
#include <SPL/Runtime/Type/List.h> | ||
|
||
namespace com_ibm_streamsx_inet_http { | ||
|
||
|
||
// We're just writing bytes. | ||
size_t populate_rstring(char *ptr,size_t size, size_t nmemb, void*userdata); | ||
|
||
SPL::rstring httpGet(const SPL::rstring & url, const SPL::list<SPL::rstring> & extraHeaders, const SPL::rstring & username, const SPL::rstring & password,SPL::int32 & error); | ||
|
||
SPL::rstring httpDelete(const SPL::rstring & url, const SPL::list<SPL::rstring> & extraHeaders, const SPL::rstring & username, const SPL::rstring & password, SPL::int32 & error); | ||
|
||
SPL::rstring httpPut(const SPL::rstring & data, const SPL::rstring & url, const SPL::list<SPL::rstring> & extraHeaders, const SPL::rstring & username, const SPL::rstring & password, SPL::list<SPL::rstring>& headers, SPL::int32 & error); | ||
|
||
SPL::rstring httpPost(const SPL::rstring & data, const SPL::rstring & url, const SPL::list<SPL::rstring> & extraHeaders, const SPL::rstring & username, const SPL::rstring & password, SPL::list<SPL::rstring>& headers, SPL::int32 & error); | ||
|
||
|
||
SPL::rstring urlEncode(const SPL::rstring & raw); | ||
|
||
SPL::rstring urlDecode(const SPL::rstring & encoded); | ||
|
||
|
||
} | ||
#endif |
2 changes: 1 addition & 1 deletion
2
...x.inet/impl/cpp/src/libftp/FTPWrapper.cpp → ...streamsx.inet/impl/cpp/src/FTPWrapper.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.