Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

http ip connection

by bigup401 (Pilgrim)
on Jun 20, 2017 at 10:20 UTC ( [id://1193131]=perlquestion: print w/replies, xml ) Need Help??

bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

am having script working on my pc. but when i host it to web hosting provider space. i get this error

malformed JSON string, neither tag, array, object, number, string or a +tom, at character offset 0 (before "Can't connect to ip...")

but works on my pc very well. i think its hosting provider problem blocking connection

here is my code

my $req = HTTP::Request->new(POST => 'http://ip:4000'); $req->content_type('application/x-www-form-urlencoded'); $req->content_type('application/json'); my $res = $ua->request($req); $respons = JSON::XS->new->decode ($res->content); $dat = $respons->{data}; $adat1 = $respons->{name};

Replies are listed 'Best First'.
Re: http ip connection
by Corion (Patriarch) on Jun 20, 2017 at 10:37 UTC

    What you get back is an error message.

    Try printing out $res->content, and also $res->status. Also check $res->is_error.

      am not sure this can do anything. the problem is not with script coz works at my side. bt not hosting space. i think hosting idea can fix this. someone told me to try to tell my host for enabling ipv6

        i have understand it now. this works but failed in Apache . which is like Apache not accepting connection from ip:400. i think htacess can solve this. to let apache accept connecting to ip:400

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1193131]
Approved by Discipulus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found