Sponsored Content
Full Discussion: Accessing REST Web Service
Top Forums UNIX for Advanced & Expert Users Accessing REST Web Service Post 303028558 by asthern14 on Thursday 10th of January 2019 11:46:17 AM
Old 01-10-2019
Accessing REST Web Service

Hello:

I have created a REST service that is currently running on a Unix server. I issued a cURL command to call the REST service and verified it's working as designed; curl --request POST command and the url I used to test it is localhost:8090/someservice/somename. I have a teammate who now wants to access this REST service via Postman. Instead of using localhost in the URL..he substituted it with the server's hostname, but he is not receiving a response.

What would the REST URL Endpoint be for this service to be called externally? Any help would be appreciated!
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Accessing Web Page

Hello, I am new to unix, but wanted to know how can we fetch data from a web page (i.e. an HTML Page), my requirement is to read an html page and wanted to create a flat file (text file) based on the contents available in the mentioned HTML page. Thanks Imtiaz (3 Replies)
Discussion started by: Imtiaz
3 Replies

2. UNIX for Dummies Questions & Answers

Need to Call Web Service from Unix

I'm a Unix and C programming newbie, and I've been tasked with calling a web service from a legacy Unix app... I've come across libxml2 and libsoup, gnome's libraries for XML/SOAP processing... But I'm seeking guidance on the development process... :o (0 Replies)
Discussion started by: jahooper
0 Replies

3. Shell Programming and Scripting

How to call a web service using perl

Hello to all, What i would like to know is how to call a web service using perl. Where can i find documentation that easy describes this procedure? Any advices will be more tha welcome. Thank you. Best Regards, Chriss_58 (3 Replies)
Discussion started by: chriss_58
3 Replies

4. Shell Programming and Scripting

Call web service from Shell

Hello All, I have to import data from xml file to mysql database multi-time a day. I think it is better to write a tool to help this. So I write a web service in php. I don't know that if we can call a web service via shell script. If it can, I think we can create a cron job to help run it... (2 Replies)
Discussion started by: hapytran
2 Replies

5. Solaris

Oracle Database and HTTPD Web Service

Hi, I have a Solaris 5.6 having an Oracle database.Now this server is being accessed by a web service interface.I cannot see anything other than httpd daemons running on my server. There is a frequent problem of the stopping of these httpd daemons . Now i am asked to find the root case.I talked... (1 Reply)
Discussion started by: asalman.qazi
1 Replies

6. UNIX for Dummies Questions & Answers

Accessing UNIX hosted web site remotely

Hi everyone- I'm relatively new to UNIX (Primarily Oracle background), wondering if anyone can help me. I did not configure Oracle Database Control (Web-Based admin interface) on the Database Server (HP-UX), however it is running and the URL is configured with an internal IP, which users have... (4 Replies)
Discussion started by: campbellg
4 Replies

7. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies

8. Shell Programming and Scripting

How to call perl web service from javascript?

Hi, I would like to call the below perl web service from javascript .Any help would be appreciated.I am new to web services.Please do the needful. Server Program(Perl Web Service) #!/usr/bin/perl use lib '/usr/lib/perl5/5.8.8/SOAP-Lite-0.65_3/lib'; use SOAP::Transport::HTTP; use Demo;... (3 Replies)
Discussion started by: liyakathali
3 Replies
RT::Client::REST::Object(3pm)				User Contributed Perl Documentation			     RT::Client::REST::Object(3pm)

NAME
RT::Client::REST::Object -- base class for RT objects. SYNOPSIS
# Create a new type package RT::Client::REST::MyType; use base qw(RT::Client::REST::Object); sub _attributes {{ myattribute => { validation => { type => SCALAR, }, }, }} sub rt_type { "mytype" } 1; DESCRIPTION
The RT::Client::REST::Object module is a superclass providing a whole bunch of class and object methods in order to streamline the development of RT's REST client interface. ATTRIBUTES
Attributes are defined by method "_attributes" that should be defined in your class. This method returns a reference to a hash whose keys are the attributes. The values of the hash are attribute settings, which are as follows: list If set to true, this is a list attribute. See "LIST ATTRIBUTE PROPERTIES" below. validation A hash reference. This is passed to validation routines when associated mutator is called. See Params::Validate for reference. rest_name This specifies this attribute's REST name. For example, attribute "final_priority" corresponds to RT REST's "FinalPriority". This option may be omitted if the two only differ in first letter capitalization. form2value Convert form value (one that comes from the server) into attribute-digestible format. value2form Convert value into REST form format. Example: sub _attributes {{ id => { validation => { type => SCALAR, regex => qr/^d+$/, }, form2value => sub { shift =~ m~^ticket/(d+)$~i; return $1; }, value2form => sub { return 'ticket/' . shift; }, }, admin_cc => { validation => { type => ARRAYREF, }, list => 1, rest_name => 'AdminCc', }, }} LIST ATTRIBUTE PROPERTIES
List attributes have the following properties: o When called as accessors, return a list of items o When called as mutators, only accept an array reference o Convenience methods "add_attr" and "delete_attr" are available. For example: # Get the list my @requestors = $ticket->requestors; # Replace with a new list $ticket->requestors( [qw(dude@localhost)] ); # Add some random guys to the current list $ticket->add_requestors('randomguy@localhost', 'evil@local'); SPECIAL ATTRIBUTES
id and parent_id are special attributes. They are used by various DB-related methods and are especially relied upon by autostore, autosync, and autoget features. METHODS
new Constructor _generate_methods This class method generates accessors and mutators based on _attributes method which your class should provide. For items that are lists, 'add_' and 'delete_' methods are created. For instance, the following two attributes specified in _attributes will generate methods 'creator', 'cc', 'add_cc', and 'delete_cc': creator => { validation => { type => SCALAR }, }, cc => { list => 1, validation => { type => ARRAYREF }, }, _mark_dirty($attrname) Mark an attribute as dirty. _dirty Return the list of dirty attributes. _mark_dirty_cf($attrname) Mark an custom flag as dirty. _dirty_cf Return the list of dirty custom flags. to_form($all) Convert the object to 'form' (used by REST protocol). This is done based on _attributes method. If $all is true, create a form from all of the object's attributes and custom flags, otherwise use only dirty (see _dirty method) attributes and custom flags. Defaults to the latter. from_form Set object's attributes from form received from RT server. param($name, $value) Set an arbitrary parameter. cf([$name, [$value]]) Given no arguments, returns the list of custom field names. With one argument, returns the value of custom field $name. With two arguments, sets custom field $name to $value. Given a reference to a hash, uses it as a list of custom fields and their values, returning the new list of all custom field names. rt Get or set the 'rt' object, which should be of type RT::Client::REST. DB METHODS
The following are methods that have to do with reading, creating, updating, and searching objects. count Takes the same arguments as "search()" but returns the actual count of the found items. Throws the same exceptions. retrieve Retrieve object's attributes. Note that 'id' attribute must be set for this to work. search (%opts) This method is used for searching objects. It returns an object of type RT::Client::REST::SearchResult, which can then be used to process results. %opts is a list of key-value pairs, which are as follows: limits This is a reference to array containing hash references with limits to apply to the search (think SQL limits). orderby Specifies attribute to sort the result by (in ascending order). reverseorder If set to a true value, sorts by attribute specified by orderby in descending order. If the client cannot construct the query from the specified arguments, or if the server cannot make it out, "RT::Client::REST::Object::InvalidSearchParametersException" is thrown. store Store the object. If 'id' is set, this is an update; otherwise, a new object is created and the 'id' attribute is set. Note that only changed (dirty) attributes are sent to the server. CLASS METHODS
use_single_rt This method takes a single argument -- RT::Client::REST object and makes this class use it for all instantiations. For example: my $rt = RT::Client::REST->new(%args); # Make all tickets use this RT: RT::Client::REST::Ticket->use_single_rt($rt); # Now make all objects use it: RT::Client::REST::Object->use_single_rt($rt); use_autostore Turn autostoring on and off. Autostoring means that you do not have to explicitly call "store()" on an object - it will be called when the object goes out of scope. # Autostore tickets: RT::Client::REST::Ticket->use_autostore(1); my $ticket = RT::Client::REST::Ticket->new(%opts)->retrieve; $ticket->priority(10); # Don't have to call store(). use_autoget Turn autoget feature on or off (off by default). When set to on, "retrieve()" will be automatically called from the constructor if it is called with that object's special attributes (see "SPECIAL ATTRIBUTES" above). RT::Client::Ticket->use_autoget(1); my $ticket = RT::Client::Ticket->new(id => 1); # Now all attributes are available: my $subject = $ticket->subject; use_autosync Turn autosync feature on or off (off by default). When set, every time an attribute is changed, "store()" method is invoked. This may be pretty expensive. be_transparent This turns on autosync and autoget. Transparency is a neat idea, but it may be expensive and slow. Depending on your circumstances, you may want a finer control of your objects. Transparency makes "retrieve()" and "store()" calls invisible: RT::Client::REST::Ticket->be_transparent($rt); my $ticket = RT::Client::REST::Ticket->new(id => $id); # retrieved $ticket->add_cc('you@localhost.localdomain'); # stored $ticket->status('stalled'); # stored # etc. Do not forget to pass RT::Client::REST object to this method. SEE ALSO
RT::Client::REST::Ticket, RT::Client::REST::SearchResult. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> perl v5.14.2 2011-12-27 RT::Client::REST::Object(3pm)
All times are GMT -4. The time now is 03:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy