Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to make https post in JavaScript

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello ranchers
I am trying to connect to an url which is on https, i am fine with the http post in java script using XmlHttpRequest, but i am unable to make a https post using the same.
Actually the java script is a part of the Phonegap which is no way different from how the java script being handled in a browser.
One more question i have is, how to provide the security certificate in order to make the https communication.
Can any one please provide me with the piece of code to make the https post.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not make XMLHttpRequest calls from http to https and https to http because of the same origin policy.

Eric
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Eric

You can not make XMLHttpRequest calls from http to https and https to http because of the same origin policy.


I am not making the call from http to https or vice versa, my requests and responses are to https only.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have noticed like my post has been edited, i am sorry if some thing what i mean to say didn't make any sense but the content of the post which has been modified is

Bear Bibeault edited it as wrote: but i am unable to make a http post using the same.


but i am facing the problem in making https post, i am not sure whether XmlHttpRequest is to be used for a https post, please correct me if i am wrong, but what i need is to make a https post, so i restored the content of the post i made here as

but i am unable to make a https post using the same.

 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there error messages? Using a tool such as Fiddler do you see the call go out?

Eric
 
mooooooo ..... tiny ad ....
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic