Mercurial > octave
annotate scripts/web/webwrite.m @ 30564:796f54d4ddbf stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
In all .txi and .texi files except gpl.txi and gpl.texi in the
doc/liboctave and doc/interpreter directories, change the copyright
to "Octave Project Developers", the same as used for other source
files. Update copyright notices for 2022 (not done since 2019). For
gpl.txi and gpl.texi, change the copyright notice to be "Free Software
Foundation, Inc." and leave the date at 2007 only because this file
only contains the text of the GPL, not anything created by the Octave
Project Developers.
Add Paul Thomas to contributors.in.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 28 Dec 2021 18:22:40 -0500 |
parents | 7854d5752dd2 |
children | f5db0112f7e8 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
3 ## Copyright (C) 2018-2022 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
27806
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
7 ## |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
9 ## |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
13 ## (at your option) any later version. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
14 ## |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
18 ## GNU General Public License for more details. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
19 ## |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
25 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
26 ## -*- texinfo -*- |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
27 ## @deftypefn {} {@var{response} =} webwrite (@var{url}, @var{name1}, @var{value1}, @dots{}) |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
28 ## @deftypefnx {} {@var{response} =} webwrite (@var{url}, @var{data}) |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
29 ## @deftypefnx {} {@var{response} =} webwrite (@dots{}, @var{options}) |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
30 ## |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
31 ## Write data to RESTful web services. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
32 ## |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
33 ## Write content to the web service specified by @var{url} and return the |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
34 ## response in @var{response}. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
35 ## |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
36 ## All key-value pairs given (@var{name1}, @var{value1}, @dots{}) are added |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
37 ## as pairs of query parameters to the body of request method (@code{get}, |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
38 ## @code{post}, @code{put}, etc.). |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
39 ## |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
40 ## @var{options} is a @code{weboptions} object that may be used to add other |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
41 ## HTTP request options. This argument can be used with either calling form. |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
42 ## See @code{help weboptions} for a complete list of supported HTTP options. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
43 ## |
27806
06af06188403
doc: Add missing DOCSTRINGs to Octave manual.
Rik <rik@octave.org>
parents:
27152
diff
changeset
|
44 ## @seealso{weboptions, webread} |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
45 ## @end deftypefn |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
46 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
47 function response = webwrite (url, varargin) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
48 |
27152
fe1fccf0d292
webread.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27151
diff
changeset
|
49 if (nargin < 2) |
28912
0de38a6ef693
maint: Use Octave convention of space after function name in scripts dir.
Rik <rik@octave.org>
parents:
28896
diff
changeset
|
50 print_usage (); |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
51 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
52 |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
53 if (! (ischar (url) && isrow (url))) |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
54 error ("webwrite: URL must be a string"); |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
55 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
56 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
57 if (isa (varargin{end}, "weboptions")) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
58 has_weboptions = true; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
59 options = varargin{end}; |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
60 varargin(end) = []; |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
61 else |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
62 has_weboptions = false; |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
63 options = weboptions (); |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
64 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
65 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
66 if (strcmp (options.MediaType, "auto")) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
67 options.MediaType = "application/x-www-form-urlencoded"; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
68 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
69 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
70 ## If MediaType is set by the user, append it to other headers. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
71 if (! strcmp (options.CharacterEncoding, "auto")) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
72 options.HeaderFields{end+1, 1} = "Content-Type"; |
27152
fe1fccf0d292
webread.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27151
diff
changeset
|
73 options.HeaderFields{end, 2} = [options.MediaType, ... |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
74 "; charset=", options.CharacterEncoding]; |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
75 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
76 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
77 if (! isempty (options.KeyName)) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
78 options.HeaderFields{end+1, 1} = options.KeyName; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
79 options.HeaderFields{end, 2} = options.KeyValue; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
80 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
81 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
82 if (strcmp (options.RequestMethod, "auto")) |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
83 options.RequestMethod = "post"; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
84 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
85 |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
86 ## Flatten the cell array because the internal processing takes place on |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
87 ## a flattened array. |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
88 options.HeaderFields = options.HeaderFields(:)'; |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
89 |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
90 nargs = numel (varargin); |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
91 if (nargs == 0) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
92 error ("webwrite: DATA must be a string"); |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
93 elseif (nargs == 1) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
94 if (ischar (varargin{1}) && isrow (varargin{1})) |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
95 param = strsplit (varargin{1}, {"=", "&"}); |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
96 response = __restful_service__ (url, param, options); |
28921
967cfcde2e35
maint: Use parentheses around conditional expressions.
Rik <rik@octave.org>
parents:
28912
diff
changeset
|
97 elseif (! iscellstr (varargin)) |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
98 error ("webwrite: DATA must be a string"); |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
99 else |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
100 response = __restful_service__ (url, varargin, options); |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
101 endif |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
102 elseif (rem (nargs, 2) == 0) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
103 if (! iscellstr (varargin)) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
104 error ("webwrite: KEYS and VALUES must be strings"); |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
105 else |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
106 response = __restful_service__ (url, varargin, options); |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
107 endif |
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
108 else |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
109 error ("webwrite: KEYS/VALUES must occur in pairs"); |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
110 endif |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
111 |
27048
159402e52cfa
New implementation of RESTful web services as part of GSoC 2018 (patch #9795).
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
diff
changeset
|
112 endfunction |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
113 |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
114 |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
115 ## Test input validation |
28896
90fea9cc9caa
test: Add expected error message <Invalid call> to BIST tests for nargin.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
116 %!error <Invalid call> webwrite () |
90fea9cc9caa
test: Add expected error message <Invalid call> to BIST tests for nargin.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
117 %!error <Invalid call> webwrite ("abc") |
27151
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
118 %!error <URL must be a string> webwrite (1, "NAME1", "VALUE1") |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
119 %!error <URL must be a string> webwrite (["a";"b"], "NAME1", "VALUE1") |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
120 %!error <DATA must be a string> webwrite ("URL", 1, weboptions ()) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
121 %!error <DATA must be a string> webwrite ("URL", 1) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
122 %!error <KEYS and VALUES must be strings> webwrite ("URL", "NAME1", 5) |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
123 %!error <KEYS/VALUES must occur in pairs> webwrite ("URL", "KEY1", "VAL1", "A") |
a498fab46e03
webwrite.m: Overhaul input validation.
Rik <rik@octave.org>
parents:
27048
diff
changeset
|
124 |